您当前的位置: 首页 >  git

庄小焱

暂无认证

  • 1浏览

    0关注

    805博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

Git——Resolve conflict解决冲突实践

庄小焱 发布时间:2021-10-08 21:49:27 ,浏览量:1

摘要

在origin仓库中代码的发有master 和其他三个分支。

修改master分支

切换到分支

提交遇到问题

[root@localhost Git_Learn]# git push origin xjl-branch1
To git@github.com:zhuangxiaoyan512/Git_Learn.git
 ! [rejected]        xjl-branch1 -> xjl-branch1 (non-fast-forward)
error: failed to push some refs to 'git@github.com:zhuangxiaoyan512/Git_Learn.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
git status
# On branch xjl-branch1
# Your branch and 'origin/xjl-branch1' have diverged,
# and have 1 and 1 different commit each, respectively.
#   (use "git pull" to merge the remote branch into yours)
#
# Changes to be committed:
#   (use "git reset HEAD ..." to unstage)
#
#       deleted:    branch1
解决办法

现将master将合并到当前分支(rebase)

git rebase master
First, rewinding head to replay your work on top of it...
Applying: "feat(service) [vxp-8695] :branc1"
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Applying: delete branch1

关注
打赏
1657692713
查看更多评论
立即登录/注册

微信扫码登录

0.0406s