git帮助命令

git帮助命令

零、自己实例

cd D://software/code/PHP/phpStudy/PHPTutorial/WWW/github/m_Orchestrate
git checkout -b 2018_4_18_second
git pull https://github.com/fry404006308/m_Orchestrate.git
git pull https://github.com/fry404006308/m_Orchestrate.git 2018_4_18_second


提交
git add .
git commit -m "提交信息"
git push -u origin 2018_4_18_second
git push -u origin master



初次
git clone https://github.com/fry404006308/m_Orchestrate.git


删除本地分支::git branch -d 2018_4_18_second
切换分支: git checkout master
新建本本地分支并将远程分支上的东西拉下来: 
git checkout -b 2018_4_18_second origin/2018_4_18_second

# 列出所有本地分支$ git branch
# 列出所有远程分支$ git branch -r
# 列出所有本地分支和远程分支$ git branch -a
# 新建一个分支,并切换到该分支$ git checkout -b [branch]

 

 

一、善用帮助,万倍效率

帮助命令这东西就像其它例如thinkphp,bootstrap,amaze ui等的使用文档,有解释有说明有实例。

善于使用帮助命令,善于使用文档,可以让你的效率 高一万倍。

其实就算我们之前完全没学,有了帮助文档,有了实例,你也能很快做很多事情。

当然同时也要善于利用百度等搜索引擎快速找到你想找到的资源。

不只有git,什么编程语言都一样,生活中的任何事情也是这样。

善用帮助文档,比起瞎折腾,强一万倍。

 

二、git 获取帮助

想了解 Git 的各式工具该怎么用,可以阅读它们的使用帮助,方法有三:

$ git help <verb>
$ git <verb> --help
$ man git-<verb>

比如,要学习 config 命令可以怎么用,运行:

$ git help config

我们随时都可以浏览这些帮助信息而无需连网。 不过,要是你觉得还不够,可以到 Freenode IRC 服务器(irc.freenode.net)上的 #git 或 #github 频道寻求他人帮助。这两个频道上总有着上百号人,大多都有着丰富的 Git 知识,并且乐于助人。

 

三、用帮助快速解决问题的实例

需求:

git本地仓库有两个分支:master 和 2018_4_18_second

git远程仓库有两个分支:master 和 2018_4_18_second

现在git远程仓库的2018_4_18_second分支有代码更新,我要同步到本地的2018_4_18_second分支上面来

 

已知:

1、

git pull https://github.com/fry404006308/m_Orchestrate.git

指令是从远程仓库https://github.com/fry404006308/m_Orchestrate.git拉取代码(其实是从远程的master分支拉取到本地的master分支)

2、

新建本地分支 2018_4_18_second并将远程分支 2018_4_18_second上的东西拉下来: git checkout -b 2018_4_18_second origin/2018_4_18_second

删除本地分支::git branch -d 2018_4_18_second

切换分支: git checkout master

 

尝试:

所以我尝试了

git pull https://github.com/fry404006308/m_Orchestrate.git  origin/2018_4_18_second

还有很多尝试,都不能达到目的

网上找很久也没找到怎么弄

 

使用帮助:

使用帮助git help pull

找到git pull的使用实例

EXAMPLES

  • Update the remote-tracking branches for the repository you cloned from, then merge one of them into your current branch:
  • $ git pull

$ git pull origin

Normally the branch merged in is the HEAD of the remote repository, but the choice is determined by the branch.<name>.remote and branch.<name>.merge options; see git-config(1) for details.

  • Merge into the current branch the remote branch next:

$ git pull origin next

This leaves a copy of next temporarily in FETCH_HEAD, but does not update any remote-tracking branches. Using remote-tracking branches, the same can be done by invoking fetch and merge:

$ git fetch origin

$ git merge origin/next

If you tried a pull which resulted in complex conflicts and would want to start over, you can recover with git reset.

 

然后一下子就豁然开朗,知道了正确的途径,就是:

git pull https://github.com/fry404006308/m_Orchestrate.git 2018_4_18_second

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值