透过SourceTree再谈Git
初出茅庐之基础篇
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是否会产生冲突?)
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:
最新文章
- 使用WebRTC搭建前端视频聊天室——点对点通信篇
- bash学习
- c++局部变量经典举例
- C# ComBox 垂直滚动条
- python deep copy and shallow copy
- [LeetCode] Min Stack
- [转]LINQ之路系列博客导航
- Cocos2dx-3.0版本 从开发环境搭建(Win32)到项目移植Android平台过程详解
- Struts2的使用以及Spring整合Struts2
- 响应式HTML5+CSS3 网站开发测试实践
- Linux安装配置JDK
- gulp edm测试
- merge into Oracle里的 saveOrUapdate
- WPF Binding
- js常用正则表达式汇总
- css基础之 图片瀑布流布局:用CSS+DIV等宽格子堆砌瀑布流效果 (一)
- Android 点亮屏幕
- Linux查看分区文件系统类型总结
- caffe程序中出现的db.cpp:#line(行号) unknown database backend问题
- byte数组和int之间相互转化的方法
热门文章
- Longest Continuous Increasing Subsequence II
- [Flutter] Custom a Slider with SliderTheme
- 任晓蕊 2019-2020-1 20199302《Linux内核原理与分析》第四周作业
- php 压缩文件
- 在Android Studio中找不到AppCompatActivity解决方案
- Hbase监控指标项
- 任意模数FFT
- js 中数组对象的定义赋值 以及方法
- GO语言strconv包的使用
- input标签type=";file";上传文件的css样式