To https://github.com/prakashperam/myrepo
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to
'https://github.com/prakashperam/myrepo.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克隆)复制代码,并进行了一些更改和添加文件。现在,我想将代码推送到远程存储库,但它让我误解了。
当我在这里做git pull时,是 ``*分支HEAD - > FETCH_HEAD 致命的:拒绝合并不相关的历史错误
答案 0 :(得分:0)
这就是我要做的事。
假设您将代码复制到〜/复制
运行以下命令
git clone https://github.com/prakashperam/myrepo ~/cloned
cd ~/cloned
git remote add localcopy ~/copied/.git
git rebase localcopy master
git push