gitbash的使用,本地建feature branch
2017-02-03 12:06
204 查看
Clone 到本地
1. 创建新文件夹, $ git clone (不要在这一级文件夹git init或右键git bash here)
2. 点击进入克隆好的文件夹,右键git bash here开始工作
push到origin(自己的远端)
$ git status 查看自己local XXbranch 和Origin XXbranch的区别
$ git add . 添加全部变动
$ git commit -s -m “closes #2” commit并添加备注
$ git push 确认push
在local feature branch修改 并push到team repository
1. 网页操作新建feature branch 新建的是origin的branch
2. $ git fetch 是origin上新建的feature branch生成local对应的feature branch
3. $ git checkout 跳转到本地的feature branch,开始进行代码部分工作
4. $ git push -u origin Local feature branch完成改动后,push到自己远端origin 对应的feature branch 上。
5. 从origin的feature branch上向team repository的默认branch(develop branch)申请PR来merge
6. $ git pull upstream develop Merge通过后,将upstream(default branch)pull到local develop branch
7. $ git status 这个时候,local develop branch 应该比origin develop branch 领先几个commits
8. $ git add . 将与team repository同步的local develop branch push到origin develop branch
9. $ git commit -s -m “comment here”
10. 创建下一个feature branch As above
备注:
• 能否merge那一页,看的是team和origin的差别(自己的远端),而不是local
• 取回origin主机的next分支,与本地的master分支合并,需要写成下面这样: $ git pull origin next:master
• 如果远程分支是与当前分支合并,则冒号后面的部分可以省略: $ git pull origin next
• 添加upstream关键字: git remote add upstream
1. 创建新文件夹, $ git clone (不要在这一级文件夹git init或右键git bash here)
2. 点击进入克隆好的文件夹,右键git bash here开始工作
push到origin(自己的远端)
$ git status 查看自己local XXbranch 和Origin XXbranch的区别
$ git add . 添加全部变动
$ git commit -s -m “closes #2” commit并添加备注
$ git push 确认push
在local feature branch修改 并push到team repository
1. 网页操作新建feature branch 新建的是origin的branch
2. $ git fetch 是origin上新建的feature branch生成local对应的feature branch
3. $ git checkout 跳转到本地的feature branch,开始进行代码部分工作
4. $ git push -u origin Local feature branch完成改动后,push到自己远端origin 对应的feature branch 上。
5. 从origin的feature branch上向team repository的默认branch(develop branch)申请PR来merge
6. $ git pull upstream develop Merge通过后,将upstream(default branch)pull到local develop branch
7. $ git status 这个时候,local develop branch 应该比origin develop branch 领先几个commits
8. $ git add . 将与team repository同步的local develop branch push到origin develop branch
9. $ git commit -s -m “comment here”
10. 创建下一个feature branch As above
备注:
• 能否merge那一页,看的是team和origin的差别(自己的远端),而不是local
• 取回origin主机的next分支,与本地的master分支合并,需要写成下面这样: $ git pull origin next:master
• 如果远程分支是与当前分支合并,则冒号后面的部分可以省略: $ git pull origin next
• 添加upstream关键字: git remote add upstream
相关文章推荐
- 如何使用Git Bash Here,将本地项目传到github上
- 如何使用Git Bash Here,将本地项目传到github上
- 如何使用Git Bash Here,将本地项目传到github上
- Git Bash+EGit在项目中配合使用最常用方法总结(根据场景使用)
- git使用之如何将github库下载到本地与如何将代码上传github
- git使用教程一 本地仓库操作
- git使用教程三 本地分支操作
- (个人原创)mac 下git 的使用(git server部署在本地局域网)
- 使用Git上传本地项目到http://git.oschina.net
- 使用git 本地文件(3)----连载
- 使用git pull文件时和本地文件冲突怎么办?
- eclipse git 插件集成与本地使用(傻瓜教程 一)
- 创建本地安全的GIT使用环境
- Git傻瓜经验——本地使用
- 使用Git将本地代码上传到GitHub
- Git安装及使用以及如何配置本地的Git服务器
- 使用本地git管理xcode代码:
- eclipse git 插件集成与本地使用(傻瓜教程 一)
- git的初步使用---本地代码库的使用和提交
- windows下使用GUI 把本地代码提交到git远程仓库