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

124,491

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
Share:
124,491

Related videos on Youtube

V.Villacis
Author by

V.Villacis

Updated on July 09, 2022

Comments

  • V.Villacis
    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
      jpmc26 over 8 years
      Keep 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
    lft93ryt over 6 years
    Just In Time answer!
  • CutePoison
    CutePoison about 5 years
    if 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
    joanis almost 3 years
    While this information is correct, I don't think it addresses the question asked here.