Skip to main content

Featured post

How to Insert line break in Text component in React Native

Hi, I was developing an application in react native.I have to handle lots of text data in this small react native application.I have used  Text component in react native many times. While working on this application,i had a requirement to display some text content with line breaks.I will explain it clearly with an example.I want to display a text as shown below  Welcome Please subscribe my channel I wrote react native code as shown below <View> <Text> Welcome Please subscribe my channel </Text> <View> When i run these lines of code,It will display text as shown below Welcome Please subscribe my channel   - instead of displaying in two lines with line break,it displays in a single line.So i have to find a solution to insert line break in Text component in React Native.After lots of research,i found a clean solution as shown below <View> <Text> Welcome{"\n"} Please subscribe my channel </Text> <View> Here ...

Error: Command failed: git status -s fatal: not a git repository (or any of the parent directories): .git

 Hi,

 not a git repository (or any of the parent directories) error


I was working in react native project but my react native project was in an old version of react native.So i planned to update my react native version to latest as of now latest version is 0.71.I found the command to upgrade version.I will share the command with you.


npx react-native upgrade


When i excuted the command it started to work but immediately ,i got the error 


info No version passed. Fetching latest...

info Fetching diff between v0.64.2 and v0.71.6...

error Command failed: git status -s

fatal: not a git repository (or any of the parent directories): .git


.

Error: Command failed: git status -s

fatal: not a git repository (or any of the parent directories): .git

    at makeError (D:\Trivia\FrontEnd\node_modules\execa\index.js:174:9)

    at D:\Trivia\FrontEnd\node_modules\execa\index.js:278:16

    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

    at async Object.upgrade [as func] (D:\Trivia\FrontEnd\node_modules\react-native\node_modules\@react-native-community\cli\build\commands\upgrade\upgrade.js:340:9)

    at async Command.handleAction (D:\Trivia\FrontEnd\node_modules\react-native\node_modules\@react-native-community\cli\build\index.js:186:9)   

info Run CLI with --verbose flag for more details.


So i decided to solve the issue.In order to solve the issue I  studied about the error and decided to make my as a local git repository.So i decided to run the command to make my project folder as local git repository.Actually i don't want push my project code to git hub.So i didn't already make project as git repository.Due to this error,i changed my mind and decided to make project sourced code in a local git repository

I used below command 

git init 


Make project directory as  a local git repository



Then i tried to upgrade react native version.It updated to latest version without error Command failed: git status -s fatal: not a git repository (or any of the parent directories): .git


Thanks