Search code examples
gitgithubmergegit-pull

How come "git pull origin master" doesn't actually change the files in my computer's directory?


I'm still quite new to GitHub, though I'm in a position where I have to actively use it.

Anyway, I used "git pull upstream master" to pull and merge the latest code for the project I'm working on. I thought this command would update the actual files on my computer (the ones that appear in the directory, etc.), but instead, nothing happens.

Sure the console mentions many changes, but none of them seemed to have happened. As an experiment, I even deleted everything from one of the files and re-pulled to see if this would change, but I get "already up-do-date".

If it helps, I typed in git branch -v and got the following:

* master a2e10a4 [ahead 29] git workflow experiment

Also, git status gives the following:

# On branch master
# Your branch is ahead of 'origin/master' by 29 commits.
#
nothing to commit (working directory clean)

As a final note, my only branch is master.

What is going on and how do I get "pulled" changes to show up on my directory/computer?


Solution

  • I suspect master isn't tracking upstream/master (as in here), which means, a git pull upstream master only fetches commit from upstream, but doesn't merge anything.
    You could merge those manually: git merge upstream/master.

    Plus, upstream isn't origin, and master is ahead from origin/master: There is nothing to pull here, only 29 new commits to push to origin (which should be your fork, that is your clone from upstream on the GitHub server side: see "What is the difference between origin and upstream on GitHub?").

    Fork and upstream