简体   繁体   中英

How to get git master back in line with head

I am trying to sync a git repo online via bitbucket. I have got in a bit of a tangle with it all, transferring the bitbucket repo to a team, changing the remotes of the repo etc... and now when I try to upload to bitbucket, it says " ! [rejected] master -> master (non-fast-forward)" . I have done git pull, and everything is mergoed ok as far as I can see. I am hoping that if I get my master tag back in line with my HEAD it will all work out again.

This is how it looks in my git client - but I am happy using the command line (which I actually use more often).

git客户端

Being on master, fast forward to the commit that has the HEAD label on it, for example using git merge <commit> . Then push it, git push bucket master .

As it seems that you are currently on a detached HEAD (I guess that's what the HEAD label means), select the HEAD commit in your GUI and write down the hash of that commit. Then you can merge to that one.

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