Alex Thomas
Alex Thomas

Reputation: 21

Why are all my files being tracked by git

I am learning React/Redux and started a new app with create-react-app . The problem I am having is that when i check git status it shows every file from the desktop as tracked and ready to be added then committed. Obviously this is not what I want but i'm not sure why this is happening and/or how to stop it. Any help will be greatly appreciated.

Upvotes: 0

Views: 1859

Answers (3)

Alex Thomas
Alex Thomas

Reputation: 21

I solved the issue by simply initializing the repo from the command line. I'd been banging my head against that wall for about a year and may have found the solution. The process was, create-react-app 'appname', then cd into the app name directory, then git init once inside the directory. I then created a new repo on github and chose the appropriate option. I think it was push existing repo from command line. Anyway, maybe this will help someone else one day.

Upvotes: 0

Bhavya Bharti
Bhavya Bharti

Reputation: 121

It is happening because you may have the .git file in root directory.

  • remove .git file // command rm -rf .git
  • cd into your project root folder // conmand cd project
  • Iniciate git //command git init
  • add repository url where you want to push // command git remote add origin ‘your repo url’
  • now check status it should be fine

Upvotes: 1

Rory O'Kane
Rory O'Kane

Reputation: 30408

Run git reset HEAD to unstage all staged changes without undoing the changes in your working tree. After that, git status should show only unstaged changes.

Upvotes: 0

Related Questions