2015-11-03 64 views
1

我在我的项目中遇到了一些问题,并且出现了一些混乱的问题,所以我查了一下旧版本。我以为我把我目前检出的版本作为主版本,并放弃了被搞砸的版本。这看起来并没有因为运行后发生:Git:删除或替换主分支

git push -u origin master 

我收到这些错误:

error: failed to push some refs to 'https://[email protected]/username/project.git' 
hint: Updates were rejected because the tip of your current branch is behind 
hint: its remote counterpart. Integrate the remote changes (e.g. 
hint: 'git pull ...') before pushing again. 
hint: See the 'Note about fast-forwards' in 'git push --help' for details 

我有混蛋一个基本的了解,并且不想要恢复到或整合妖主分支。我很确定'git pull'正是我不想要的。我在找什么命令?

回答

1

公布的历史(上到位桶 “出身” 侧):

--o--o--o--o--O (origin/master) 

在你身边:

--o--o--o--o (master) 

如果您想通过master更换origin/master,你将不得不push --force -u origin master
请谨慎对待,并检查其他人是否已在使用origin/master之前更改其历史记录。