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

 


我的旨在学过的东西不再忘记(主要使用艾宾浩斯遗忘曲线算法及其它智能学习复习算法)的偏公益性质的完全免费的编程视频学习网站: ​​fanrenyi.com​​;有各种前端、后端、算法、大数据、人工智能等课程。

​版权申明:欢迎转载,但请注明出处​

一些博文中有一些参考内容因时间久远找不到来源了没有注明,如果侵权请联系我删除。

博主25岁,前端后端算法大数据人工智能都有兴趣。