初出茅庐之基础篇

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. (转载) 搭建非域AlwaysOn win2016+SQL2016

    非域搭建Alwayson只是省去搭建域控那一部分,其他大同小异 条件: 操作系统:windows server 2016 数据库:SQL Server 2016 SSMS版本:17.3 节点1:HDD ...

  2. luogu T96516 [DBOI2019]持盾 可持久化线段树+查分

    因为题中的操作是区间加法,所以满足前缀相减性. 而每一次查询的时候还是单点查询,所以直接用可持久化线段树维护差分数组,然后查一个前缀和就行了. code: #include <bits/stdc ...

  3. 删除tppabs,href="javascript:if(confirm)...",、/*tpa=http://...

    扒网站,据说是web从业人员的必备技能; 废话不多,下面应该是你想要的; 1:   tppabs="h[^"]*" 2: href="javascript\:i ...

  4. 数据库应用之--Redis+mysql实现大量数据的读写,以及高并发

    一.开发背景 在项目开发过程中中遇到了以下三个需求: 1. 多个用户同时上传数据: 2. 数据库需要支持同时读写: 3. 1分钟内存储上万条数据: 根据对Mysql的测试情况,遇到以下问题: 1. 最 ...

  5. leetcode解题报告(31):Kth Largest Element in an Array

    描述 Find the kth largest element in an unsorted array. Note that it is the kth largest element in the ...

  6. P4555 【[国家集训队]最长双回文串】

    不知道有没有人跟我一样数据结构学傻了 首先这道题是要求回文串,那么我们可以想到manacher算法 但由于\(manacher\)不能求出双回文子串,我们要考虑一些性质 首先对于一个回文串,删掉两边的 ...

  7. javascript 是实际上最容易被误解的语言

    不是立 Flag,而是摘录的 JSON 创始人的深切感受.如果你不同意,说明还理解的不够深入(kidding~)   “JavaScript is the world’s most misunders ...

  8. js文件 与 css文件 异步加载

    使用lazyload 异步加载css js 文件. 提升页面初始化的速度,减少卡顿时间 , 下面是 使用方法 与 lazyload.js 源码 (中文注释) 调用方法后. 会追加到 head 标签末尾 ...

  9. Java 学习之路(1)第一个Java程序

    Hello World程序 在编程语言的世界里,第一个编程语言估计就是输出Hello World了吧. /** * 编写第一个Java程序,输出Hello World! * @author LJS * ...

  10. NAT双线路配置详解