问题
when I git push, it says "everything up to date", but when I do git branch -vv, it says this:
MacBook-Pro:gitpracticing c$ git branch -vv
gh-pages 19f1cfc made after dinner
* ghpages 4aacdb1 [origin/gh-pages: ahead 11] yea
master 4aacdb1 [origin/gh-pages: ahead 11] yea
MacBook-Pro:gitpracticing corey$
even though I do git push, the origin/gh-pages branch is still ahead by 11. How do I fix this? So I have 3 branches: "gh-pages", "ghpages", and "master". I notice that when I'm on the gh-pages branch, I can only push to origin/gh-pages, and not origin/master. When I'm on the master branch, I can only push to origin/master, and not origin/gh-pages. Why is this? How can I push to both?
回答1:
That happens because you setted up ghpages to match origin/ghpages. You can, however, specify the remote branch that will receive your commits using one more parameter in the command
git push origin ghpages:origin/master
More on git push docs, here PS: search for "git push mothership master:satellite/master dev:satellite/dev" for an example of the sollution I gave you.
来源:https://stackoverflow.com/questions/29359754/git-not-pushing-correctly-for-github-gh-pages