Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【git merge】创建分支与分支合并 #7

Open
Kelichao opened this issue Mar 19, 2017 · 0 comments
Open

【git merge】创建分支与分支合并 #7

Kelichao opened this issue Mar 19, 2017 · 0 comments

Comments

@Kelichao
Copy link
Owner

Kelichao commented Mar 19, 2017

创建分支,合并到主干

  1. 先将仓库clone下来 git clone git@.....

如果是下载分支代码则 git clone -b dev git@...

  1. 创建并切换到dev分支(自己新的,原来只有master) git checkout -b dev
  2. 然后在当前分支(dev)修改文件.
  3. 先切换回原来的master分支 git checkout master
  4. 通过merge指令将dev的代码合并到master git merge dev
  5. 提交代码到远端仓库 git push origin master

在代码仓库创建分支

  1. 先将仓库clone下来 git clone git@.....
  2. 创建并切换到新分支git checkout -b "testmdev"
  3. 将新分支上传到网上的代码仓库git push origin testmdev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant