简体   繁体   中英

Git not pushing correctly for Github gh-pages

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM