This might be happening because of some conflict files present in your repository . And you was still trying to check in files . So After that what happen , it will check in your local repository not in master repository . So u was not able to pull or check in anythings in master(head) repository .
To get all the changes from all the branches, use git fetch --all . And if you'd like to clean up some of the branches that no longer exist in the remote repository, git fetch --all --prune will do the cleaning up!
One explanation would be that the latest commits have been done on another branch, as explained in "Git pull from my public repository not working". The other possibility is for you to be in a detached HEAD mode. That would make any git pull "up-to-date" since you are in any branch.
git pull fetches updates for all local branches, which track remote branches, and then merges the current branch.
If you always want your server version to reflect a commit from your repo, it's probably better to use git reset
instead of git pull
- that way you never invoke merge functionality, but instead set all of the files to exactly what they are in the commit you reset to. For example:
git fetch origin master
git reset --hard FETCH_HEAD
You can use git pull origin branch_name of the github
.
Ex: If I have a production branch on GitHub, then I will write git pull origin production
which will give me all the latest commits.
Only doing git pull
sometimes does not give you the latest commits of production branch even though you are working on that branch and committing it.
Behind the scenes working
http://git-scm.com/docs/git-pull#_default_behaviour
Explanation and Examples
Try cleaning-up your local repository with and then run git pull:
$ git gc --prune=now
$ git remote prune origin
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With