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

最新文章

  1. [转]学术型 github 畅想
  2. [转]ASP.NET MVC 3 Razor + jqGrid 示例
  3. 设计模式--中介(Mediator)模式
  4. 优化磁盘I/O
  5. BZOJ3210: 花神的浇花集会
  6. Ubuntu 用户及组管理
  7. jsp页面获取服务器时间
  8. CSS 背景 background 讲解
  9. iOS推送跳转AppDelegate跳转VC
  10. mac下导出kindle单词本的单词
  11. libpng处理png图片(二)
  12. 201521123093 java 第五周学习总结
  13. gradle入门(1-1)gradle的概念和使用
  14. .net core引用错误的Entity Framework而导致不能正常迁移数据的解决办法
  15. 在windows上安装wamp时遇到apache无法启动,图标为橙色
  16. JS运算符问题
  17. Variational RL for POMDP
  18. [原][osgEarth][JSBSim]重新整理使用JSBSim飞机动力模拟的使用
  19. tomcat gzip
  20. beautiful number 数位DP codeforces 55D

热门文章

  1. word中输入公式方案
  2. CentOS7 安装 MySQL 5.7
  3. mycat详细
  4. MS ACCESS MID函数
  5. PAT(B) 101-111-1-2014-03-01
  6. vue2.0 路由学习笔记
  7. C++学习第一天--编译命令
  8. Android jni 二维数组 传递
  9. 基于机器学习的web异常检测——基于HMM的状态序列建模,将原始数据转化为状态机表示,然后求解概率判断异常与否
  10. Activity的启动模式和onNewIntent()