Why doesn't git pull origin master actually modify the files in my computer directory?

I am still new to Github, although I am in a position where I have to actively use it.

In any case, I used the "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 (those that appear in the directory, etc.), but nothing happens instead.

Of course, many changes are mentioned in the console, but none of them seem to have happened. As an experiment, I even deleted everything from one of the files and dragged to see if this changes, but I get an โ€œalready updated dateโ€.

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

 * master a2e10a4 [ahead 29] git workflow experiment 

In addition, 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 the master.

What happens and how can I get the โ€œpulledโ€ changes to display in my directory / computer?

Thanks.

+7
source share
2 answers

I suspect that the master does not track upstream/master (here here ), which means that git pull upstream master only does the commit from upstream , but doesn't merge everything.
You can combine them manually: git merge upstream/master .

Plus, upstream not origin , but master ahead of origin/master : do not pull anything here, only 29 new commits to click on the origin (this should be your fork, that is, your clone from the upstream on the GitHub server side: see " What is the difference between origin and upstream on github ?).

fork and upstream

+3
source

You typed the git pull upstream master command. This command fetches and then merges the changes from the upstream to your local branch.

A git status message indicates that everything in your upstream is already merged with your local master. But you have not clicked, clicked your changes on the remote control. In other words, you have made your changes to the local repository, but you have not yet pushed them to the remote computer. In a distributed VCS such as git, commit and push are not the same thing.

Type git push origin master to send the changes to the remote. This will cause everything to be synchronized.

If this does not work, you may need to restart the local repository. To reinstall the remote origin in your local work, enter git pull -r origin master . Then type git push origin master .

If you are not sure if you are ready to push or not, you can always do a dry run with git push origin master --dry-run , and none of your changes will really be pushed.

+3
source

All Articles