In Git how can you check which repo in Github you are pushing to from the command line?

V.Villacis picture V.Villacis · Nov 22, 2015 · Viewed 65.9k times · Source

I have several projects I am working on. I am constantly pulling and pushing. Recently I made some changes to one of my files, added and committed and decided to push my project A, however it pushed into my Github Project B. I then did git pull for kicks and it this happened.

  • branch master -> FETCH_HEAD Already up-to-date.

It did not pull none of my files from Project B. I then did git status and it showed every single file/folders in my directory as needing to be committed. How would I know which "init" I am on? How can I switch out of this state and how can I disregard these blind commits without losing my files?

Answer

TLJ picture TLJ · Nov 22, 2015

I think you need to reconfig git remote

type git remote -v and see if there's a mismatch or not.
If there is, follow this instruction from github: https://help.github.com/articles/changing-a-remote-s-url/