初出茅庐之基础篇

1. Download SourceTree from:

https://www.sourcetreeapp.com/

2.Complete the installation.

3.After installation, you can see below page:

4.Clone a repository from the remote url:

5.When you open the repository, click Branch of the menu to create a new branch named Dev:

6.Click Push of the menu, select the newly created branch and push it to the remote, then it will be a remote branch:

7.Now you can see the new remote branch from the left panel:

声名鹊起之进阶篇

1->git pull vs git fetch

In the simplest terms, git pull does a git fetch followed by a git merge.

  • When you use pull, Git tries to automatically do your work for you. It is context sensitive, so Git will merge any pulled commits into the branch you are currently working in. pull automatically merges the commits without letting you review them first. If you don’t closely manage your branches, you may run into frequent conflicts.
  • When you fetch, Git gathers any commits from the target branch that do not exist in your current branch and stores them in your local repository. However, it does not merge them with your current branch. This is particularly useful if you need to keep your repository up to date, but are working on something that might break if you update your files. To integrate the commits into your master branch, you use merge.

One of the git tips that I find myself frequently passing on to people is:

  • Don’t use git pull, use git fetch and then git merge.

(Q:如果开发的feature已经commit到了local repository,此时通过git fetch是否会产生冲突?)

2->git rebase vs git merge

Rebasing is the process of moving or combining a sequence of commits to a new base commit. Rebasing is most useful and easily visualized in the context of a feature branching workflow. The general process can be visualized as the following:

透过SourceTree再谈Git的更多相关文章

  1. 再谈git和github-深入理解-3

    git tag -a 和 -m的区别? -a是 注解 是单词 "annotate"的意思 , 表示 "给标签一个名字, 标签名 -m 是创建标签时的消息备注 git ta ...

  2. 再谈git和github-深入理解-2

    github中的 sloc是什么意思? sloc: source lines of code: 代码行数, 源代码行. 要向仓库中 create file/upload file/edit file等 ...

  3. 再谈git和github-深入理解

    git中的 objects 和 refs 是什么? 目录objects是仓库的 "对象库" , 是包含 代码, 提交, 日志, 信息, 索引等信息的关键所在 refs是一些 sha ...

  4. 再谈git的http服务-权限控制gitweb版(未成功)

    截至目前,对gitweb的掌握还没达到最终目标,仅仅实现了通过浏览器来浏览项目,通过git命令仍然未能clone项目.但仍然要记录下来,主要是因为打算暂时放弃这条路,而所收获的一些经验还是要记录下来. ...

  5. 再谈git的http服务-权限控制hooks版

    通过git-http-backend方法提供的http服务基本上可以做到认证用户才能使用,但只能控制到服务器路径访问,而且无法区分读写.经过不懈努力,找到了方法,相关脚本及配置见后. 基本思路就是利用 ...

  6. 再谈git的http服务

    因为git服务器搬迁,需要重新安装git服务器,在网上搜索了下,发现之前的方法太复杂,复杂到自己都没彻底弄明白.其实通过git自带的git-http-backend脚本配合apache2的http服务 ...

  7. 基于SourceTree 下的 Git Flow 模型

    基于SourceTree 下的 Git Flow 模型 1. sourceTree  是一个开源的git 图形管理工具,可下载mac版本,windows版本 2. Git Flow 是一套使用Git进 ...

  8. 浅谈GIT

    浅谈GIT: 牛老师提出的git,于我而言,是一个陌生和新鲜的词汇,在此之前我从未听过git,按照老师的要求,我去搜索了关于git的介绍,有些看懂了,但大部分还是不懂得,在介绍中我了解git其实之前使 ...

  9. 开发工具--浅谈Git

    工具|浅谈Git Git这个工具,是我一直想写文章,终于我实现了我的想法.在我开始写之前,发表一下自己的看法,git只是一个工具,既然已经认定是一个工具,那么一定具备工具这类的共同特征,请用面向对象的 ...

随机推荐

  1. 【贪心】Communication System POJ 1018

    题目链接:http://poj.org/problem?id=1018 题目大意:有n种通讯设备,每种有mi个制造商,bi.pi分别是带宽和价格.在每种设备中选一个制造商让最小带宽B与总价格P的比值B ...

  2. Coins in a Line

    Description There are n coins in a line. Two players take turns to take one or two coins from right ...

  3. [INS-07003] 访问 BeanStore 时出现意外错误

    oracle安装时出现以下问题: 原因:未配置环境变量CLASSPASH 解决方法:新增系统变量 变量名:CLASSPASH 变量值: .;%JAVA_HOME%\lib;%JAVA_HOME%\li ...

  4. js文件夹上传下载组件

    核心原理: 该项目核心就是文件分块上传.前后端要高度配合,需要双方约定好一些数据,才能完成大文件分块,我们在项目中要重点解决的以下问题. * 如何分片: * 如何合成一个文件: * 中断了从哪个分片开 ...

  5. js 的数组怎么push一个对象. Js数组的操作push,pop,shift,unshift JavaScrip

    push()函数用于向当前数组的添加一个或多个元素,并返回新的数组长度.新的元素将会依次添加到数组的末尾. 该函数属于Array对象,所有主流浏览器均支持该函数. 语法 array.push( ite ...

  6. C语言实现文件类型统计函数

    #include<dirent.h> #include<limits.h> #include<sys/stat.h> #include<stdio.h> ...

  7. 1.xml解析

    public static void main(String[] args) throws DocumentException {         SAXReader saxReader = new ...

  8. Struts动态结果集,了解一些就好

    Struts动态结果集dynamic_result    在struts配置文件中${成员变量}(不是EL表达式,是ognl表达式)符号可以从value stack(即值栈)中取值,可以在action ...

  9. meshing-网格加密

    ​原视频下载:http://yunpan.cn/cujvm8VbAPJZi  访问密码 0d3b

  10. hdoj 1010-Tempter of the Bone

    Problem Description The doggie found a bone in an ancient maze, which fascinated him a lot. However, ...