首页 > 其他 > 详细

Git 使用常用命令

时间:2018-08-06 12:11:14      阅读:171      评论:0      收藏:0      [点我收藏+]

  使用简单Git命令控制代码版本。

(注:[]中的只需首次输入)

新项目 git init #初始化本地git仓库 git remote add origin http://git.itwecard.com/dingziting/test.git #关联远程仓库地址 常用 git pull #从线上获取代码 git add . # 添加到待提交缓存 git commit -m "Initial commit" # 提交至本地仓库 git push [-u origin master] # 上传至线上仓库 分支管理 : 默认master(生产)分支 git checkout [-b] branchname # 创建[并进入该分支] ...正常写代码 git add . # 添加到待提交缓存 git commit -m "Initial commit" # 提交至本地仓库 git push [-u origin master] # 上传至线上仓库 合并分支 例如:develop分支需合并入master分支 git pull git add . git commit -m ‘remark‘ git push git checkout master # 进入master git merge --no-ff develop # 合并develop分支 git push # 提交远程仓库 git checkout develop # 进入develop分支继续开发

Git 使用常用命令

原文:https://www.cnblogs.com/dztHome/p/9429508.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!