收入啤酒88 发表于 2018-9-16 10:51:22

Git 分支合并冲突及合并分类

##查看下当前分支状态  git status
  On branch master
  Your branch is up-to-date with 'origin/master'.
  You have unmerged paths.
  (fix conflicts and run "git commit")
  (use "git merge --abort" to abort the merge)
  Unmerged paths:
  (use "git add ..." to mark resolution)
  both added:      read.txt
  no changes added to commit (use "git add" and/or "git commit -a")
  ##查看一下readme.txt中的内容
  cat read.txt
  > datagrand
  ##说明:Git用标记出不同分支的内容,让我们选择要保留的内容,下面我们修改一下readme.txt,再次提交。
  ##操作步骤如下:
  vim read.txt
  git add read.txt
  git commit -m "fixed"
   fixed
  git status
  On branch master
  Your branch is ahead of 'origin/master' by 2 commits.
  (use "git push" to publish your local commits)
  nothing to commit, working tree clean
  cat read.txt
  this is git file!
  ##分支合并
  git merge datagrand
  ##查看合并后状态
  git status
  On branch master
  Your branch is ahead of 'origin/master' by 2 commits.
  (use "git push" to publish your local commits)
  nothing to commit, working tree clean

页: [1]
查看完整版本: Git 分支合并冲突及合并分类