首页 > 其他 > 详细

git 分支

时间:2016-09-29 01:12:32      阅读:212      评论:0      收藏:0      [点我收藏+]

什么动作,关键看你想完成什么

1. 添加新的远程分支:

git push origin current_local_branch:new_remote_branch

2. 删除远程分支(冒号前必须要有空格)

git push origin :remote_branch

3. 切换到远程分支(只作临时)

git checkout remotes/origin/new_remote_branch

4. clone远程某个分支

git clone -b new_remote_branch https://github.com/***/***.github.git

5. 新建repo

  • 首先在github上新建一个repo
  • 然后github也有提示
    echo "# repo_test" >> README.md
    git init
    git add README.md
    git commit -m "first commit"
    git remote add origin https://github.com/aaronRong/repo_test.git
    git push -u origin master
  • git branch -a 可以看到本地出现了remotes/origin/master分支

git 分支

原文:http://www.cnblogs.com/aaronLinux/p/5918330.html

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