In Git how can you check which repo in Github you are pushing to from the command line?
Solution 1
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/
Solution 2
You can check the configs of your repository by :
git config -l
which contains your remote repository url.
Also, you can use the following command :
git remote -v
Related videos on Youtube
V.Villacis
Updated on July 09, 2022Comments
-
V.Villacis almost 2 years
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?
-
jpmc26 over 8 yearsKeep in mind that in the worst case, you can always clone a new repo from the correct location and the just drop all your current files into it.
-
lft93ryt over 6 yearsJust In Time answer!
-
CutePoison about 5 yearsif I run
git config -l
it does not show me the remote url just a lot of the settings (user.name, user.email etc.) -
joanis almost 3 yearsWhile this information is correct, I don't think it addresses the question asked here.