如何将我的本地git回购添加到我现有的bitbucket回购中



此处存在我的本地回购名称:cd /Volumes/D/Website

Repo文件夹名称:Supro

我的Bitbucket回购:https://Suprodeep@bitbucket.org/Suprodeep/testlabs.git

当我尝试git push时,它会这样说:

supro@Homes-MacBook-Air Website % git push supro master           
*To https://bitbucket.org/Suprodeep/testlabs.git
! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'https://bitbucket.org/Suprodeep/testlabs.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
supro@Homes-MacBook-Air Website %*

当我尝试先拉,然后拉:

git pull supro master --allow-unrelated-histories
*error: You have not concluded your merge (MERGE_HEAD exists).
hint: Please, commit your changes before merging.
fatal: Exiting because of unfinished merge.*

听起来您有未合并的更改。试着在你的回购和拉动中承诺一切:

# Check what's not committed
git status 
# Add everything if you have to, or individually depending on what you want
git add *
git commit
# Then pull
git pull supro master --allow-unrelated-histories

如果你不关心合并。您可以硬重置为HEAD,然后拉动

git reset --hard HEAD
git pull supro master --allow-unrelated-histories

最新更新