git fetch p和git pull的区别

欢迎你的到来:
我们希望这里留下你们的脚印:最诚心学习Linux的小鸟们,最热爱Linux的朋友们,最精通Linux的高手们。
我们的希望从日开始。
看看最新文章
文章发布时间日历
January 2015
12131415161718
19202122232425
262728293031
2 log -p的中-p的作用
3 merge的用法及参数用法
4 fetch的用法
5 pull的用法
6 commit信息详解
7 HEAD的含义及相关用法,ORIG_HEAD的用法以及其他常量的使用方法
8 tag的用法
下面我们就一一总结上述问题。
commit和commit -a的区别
commit -a相当于:
第一步:自动地add所有改动的代码,使得所有的开发代码都列于index file中
第二步:自动地删除那些在index file中但不在工作树中的文件
第三步:执行commit命令来提交
log -p的中-p的作用
git log:显示commit日志
git log -p:不仅显示commit日志,而且同时显示每次commit的代码改变。
merge的用法及参数用法
git-merge主要用于将两个或两个以上的开发分支进行合并。
git merge branchname 用于将branchname分支合并到当前分支中。(如果合并发生冲突,需要自己解决冲突)
当merge命令自身无法解决冲突的时候,它会将工作树置于一种特殊的状态,并且给用户提供冲突信息,以期用户可以自己解决这些问题。当然在这个时候,未发生冲突的代码已经被git merge登记在了index file里了。如果你这个时候使用git diff,显示出来的只是发生冲突的代码信息。
在你解决了冲突之前,发生冲突的文件会一直在index file中被标记出来。这个时候,如果你使用git commit提交的话,git会提示:filename.txt needs merge
在发生冲突的时候,如果你使用git status命令,那么会显示出发生冲突的具体信息。
在你解决了冲突之后,你可以使用如下步骤来提交:
第一步:git add filename.txt
第二步:git commit
如果你希望撤销一个分支到merge前的状态,那么使用如下命令:
$ git reset –hard HEAD //–hard表示将working tree和index file都撤销到以前状态
在这先偷偷的告诉你,–soft表示只撤销commit,而保留working tree和index file的信息,–mixed会撤销commit和index file,只保留working tree的信息。OK,如果你能记住–hard、–mixed和–soft的区别,那最好,如果记不住,也不用自责啦,以后还会讲到。
fetch的用法
git-fetch用于从另一个reposoitory下载objects和refs。
命令格式为:git fetch &options& &repository& &refspec&…
其中&repository&表示远端的仓库路径。
其中&refspec&的标准格式应该为&src&:&dst&,&src&表示源的分支,如果&dst&不为空,则表示本地的分支;如果为空,则使用当前分支。
git fetch /home/bob/myrepo master:bobworks :用于从bob的工作目录的master分支下载objects和refs到本地的bobworks分支中。
pull的用法
git-pull的作用就是从一个repository取出内容并合并到另一个repository中。
git pull是git fetch和git merge命令的一个组合。
git pull /home/bob/myrepo 这个命令的意思是从此目录中取出内容并合并到当前分支中。
git pull .就相当于git merge。
commit信息详解
你使用git log可以看到每一次commit的信息,大约如下格式:
[rocrocket@wupengchong project]$ git log
commit 5b888402aadd3cd41b3fe8c84ab20
Author: rocrocket &&
Wed Sep 24 13:16:46
after pull from rocrocket
Hello!!!!!
可以看到黑体部分为本次commit的ID号,你可以根据这个号码,使用git show来显示这次commit的更详细的信息,包括了提交时间、修改内容、git diff信息等等。
常量的使用方法
HEAD:表示最近一次的commit。
MERGE_HEAD:如果是merge产生的commit,那么它表示除HEAD之外的另一个父母分支。
FETCH_HEAD:使用git-fetch获得的object和ref的信息都存储在这里,这些信息是为日后git-merge准备的。
HEAD^:表示HEAD父母的信息
HEAD^^:表示HEAD父母的父母的信息
HEAD~4:表示HEAD上溯四代的信息
HEAD^1:表示HEAD的第一个父母的信息
HEAD^2:表示HEAD的第二个父母的信息
COMMIT_EDITMSG:最后一次commit时的提交信息。
主要作用是给某次commit起一个好记的名字:
[rocrocket@wupengchong project]$ git tag V3 5b888 //以后可以用V3来代替复杂的名称(5b888…)
[rocrocket@wupengchong project]$ git show V3
ps:我敢肯定,读者一定还有很多迷惑之处,但是到目前为止,作为一个初级用户,你简单地使用git已经没有任何问题了。我们如果想继续提高,需要的是对基本命令的更加熟练使用,以及对git原理的了解和把握。
如果你对git感兴趣,请继续阅读:
作者 rocrocket 于 3:32 pm
文章标签: , , ,
6 Comments to 《看日记学git》之十八(点睛)我们把在Git里常用的一些名词做了解释列在这里。这些名词(terms)全部来自。
alternate object database
Via the alternates mechanism, a repository
can inherit part of its object database
from another object database, which is called "alternate".
bare repository
A bare repository is normally an appropriately
named directory with a `.git` suffix that does not
have a locally checked-out copy of any of the files under
revision control. That is, all of the `git`
administrative and control files that would normally be present in the
hidden `.git` sub-directory are directly present in the
`repository.git` directory instead,
and no other files are present and checked out. Usually publishers of
public repositories make bare repositories available.
A bare repository is normally an appropriately
named directory with a `.git` suffix that does not
have a locally checked-out copy of any of the files under
revision control. That is, all of the `git`
administrative and control files that would normally be present in the
hidden `.git` sub-directory are directly present in the
`repository.git` directory instead,
and no other files are present and checked out. Usually publishers of
public repositories make bare repositories available.
blob object(二进制对象)
没有类型的数据对象。例如:一个文件的内容。
A "branch" is an active line of development.
The most recent
commit on a branch is referred to as the tip of
that branch.
The tip of the branch is referenced by a branch
head, which moves forward as additional development
is done on the branch.
A single git
repository can track an arbitrary number of
branches, but your working tree is
associated with just one of them (the "current" or "checked out"
branch), and HEAD points to that branch.
一个“分支”是开发过程中的(active line)。。。。
cache(缓存)
索引(index)的旧称(obsolete).
chain(链表)
一串对象,其中每个对象都有指向其后继对象的引用(reference to its successor)。例如:一个提交(commit)的后继对象就是它的父对象。
changeset(修改集)
BitKeeper/cvsps 里对于提交(commit)的说法。但是 git 只存储快照(states),不存储修改;所以这个词用在 git 里有点不大合适。
checkout(签出)
用对象仓库(object database)里的一个树对象(tree object)更新当前整个工作树(worktree),或者一个二进制对象(blob object)更新工作树的一部分;如果工作树指向了一个新的分支,那么就会更新索引(index)和HEAD。
cherry-picking
In SCM jargon, "cherry pick" means to choose a subset of
changes out of a series of changes (typically commits) and record them
as a new series of changes on top of a different codebase. In GIT, this is
performed by the "git cherry-pick" command to extract the change introduced
by an existing commit and to record it based on the tip
of the current branch as a new commit.
cherry-picking
在SCM的行话里,“cherry pick“ 意味着从一系列的修改中选出一部分修改(通常是提交),应用到当前代码中。()
clean(干净)
如果一个工作树(working tree)中所有的修改都已提交到了当前分支里(current head),那么就说它是干净的(clean),反之它就是脏的(dirty)。
As a verb: The action of storing a new snapshot of the project's
state in the git history, by creating a new commit representing the current
state of the index and advancing HEAD
to point at the new commit.
commit(提交)
作为名词:指向git历史的某一点的指针;整个项目的历史就由一组相互关联的提交组成的。提交(commit)在其它版本控制系统中也做"revision"或"version"。同时做为提交对象(commit object)的缩写。
作为动词:创建一新的提交(commit)来表示当前索引(index)的状态的行为,把 HEAD 指向新创建的提交,这一系列把项目在某一时间上的快照(snapshot)保存在git历史中的操作。
一个关于特定版本信息(particular revision)的对象。包括父对象名,提交者,作者,日期和存储了此版本内容的树对象名(tree object)。
Git的基本数据结构和工具,它只对外提供简单的代码管理工具。
有向无环图。众多提交对象(commit objects)组成了一个有向无环图;因为它们都有直接父对象(direct parent),且没有一条提交线路(chain)的起点和终点都是同一个对象。
dangling object(悬空对象)
一个甚至从其它不可达对象也不可达的对象(unreachable object);仓库里的一个悬空对象没有任何引用(reference)或是对象(object)引用它。
detached HEAD(分离的HEAD)
通常情况下HEAD里是存放当前分支的名字。然而 git 有时也允许你签出任意的一个提交(commit),而不一定是某分支的最近的提交(the tip of any particular branch);在这种情况下,HEAD就是处于分离的状态(detached)。
译者注:这时.git/HEAD中存储的就是签出的提交的SHA串值。
请参见索引(index)。
directory(目录)
执行"ls"命令所显示的结果 :-)
dirty(脏)
一个工作树里有没有提交到当前分支里修改,那么我就说它是脏的(dirty)。
某些人给树名(tree-ish)起的另外一个别名,这里http://en.wikipedia.org/wiki/Ent_(Middle-earth)有更详细的解释。最好不要使用这个名词,以免让大家糊涂。
evil merge(坏的合并)
如果一次合并引入一些不存在于任何父对象(parent)中的修改,那么就称它是一个坏的合并(evil merge)。
fast forward
A fast-forward is a special type of merge where you have a
revision and you are "merging" another
branch's changes that happen to be a descendant of what
you have. In such these cases, you do not make a new merge
commit but instead just update to his
revision. This will happen frequently on a
tracking branch of a remote
repository.
“fast-forward”是一种特殊的合并,()。
在这种情况下,并没有创建一个合并提交(merge commit),只是更新了版本信息。
当本地分支是远端仓库(remote repository)的跟踪分支时,这种情况经常出现。
fetch(抓取)
抓取一个分支意味着:得到远端仓库(remote repository)分支的head ref,找出本地对象数据库所缺少的对象,并把它们下载下来。你可以参考一下 。
file system(文件系统)
Linus Torvalds 最初设计 git 时,是把它设计成一个在用户空间(user space)运行的文件系统;也就是一个用来保存文件和目录的 infrastructure,这样就保证了git的速度和效率。
git archive
对玩架构的人来说,这就是仓库的同义词。
Grafts enables two otherwise different lines of development to be joined
together by recording fake ancestry information for commits. This way
you can make git pretend the set of parents a commit has
is different from what was recorded when the commit was
created. Configured via the `.git/info/grafts` file.
hash(哈希)
在git里,这就是对象名(object name)的同义词。
指向一个分支最新提交的命名引用(named reference)。除非使用了打包引用(packed refs),heads 一般存储在 $GIT_DIR/refs/heads/。
当前分支。详细的讲是:你的工作树(working tree)通是从HEAD所指向的tree所派生的来的。
HEAD 必须是指向一个你仓库里的head,除非你使用分离的HEAD(detached HEAD)。
head的同义词。
During the normal execution of several git commands, call-outs are made
to optional scripts that allow a developer to add functionality or
checking. Typically, the hooks allow for a command to be pre-verified
and potentially aborted, and allow for a post-notification after the
operation is done. The hook scripts are found in the
`$GIT_DIR/hooks/` directory, and are enabled by simply
removing the `.sample` suffix from the filename. In earlier versions
of git you had to make them executable.
在一些git命令的执行过程中, () 允许开发人员调用特别的脚本来添加功能或检查。
Typically,钩子允许对一个命令做pre-verified并且可以中止此命令的运行;同时也可在这个命令执行完后做后继的通知工作。这些钩子脚本放在`$GIT_DIR/hooks/`目录下,你只要把这它们文件名的`.sample`后缀删掉就可以了。不过在git的早期版本,你需要为这些钩子脚本加上可执行属性。
A collection of files with stat information, whose contents are stored
as objects. The index is a stored version of your
working tree. Truth be told, it can also contain a second, and even
a third version of a working tree, which are used
when merging.
描述项目状态信息的文件,。索引里保存的是你的工作树的版本记录。()
index entry
The information regarding a particular file, stored in the
index. An index entry can be unmerged, if a
merge was started, but not yet finished (i.e. if
the index contains multiple versions of that file).
主分支 (master)
默认的开发分支。当你创建了一个git仓库,一个叫"master"的分支就被创建并且成为当前活动分支(active branch)。在多数情况下,这个分支里就包含有本地的开发内容。
As a verb: To bring the contents of another
branch (possibly from an external
repository) into the current branch.
case where the merged-in branch is from a different repository,
this is done by first fetching the remote branch
and then merging the result into the current branch.
combination of fetch and merge operations is called a
Merging is performed by an automatic process
that identifies changes made since the branches diverged, and
then applies all those changes together.
In cases where changes
conflict, manual intervention may be required to complete the
merge(合并)
作为动词:把另外一个分支(也许来自另外一个仓库)的内容合并进当前的分支。()
作为名词:除非合并的结果是 fast forward;那么一次成功的合并会创建一个新的提交(commit)来表示这次合并,并且把合并了的分支做为此提交(commit)的父对象。这个提交(commit)也可以表述为“合并提交”(merge commit),或者就是"合并"(merge 名词)。
object(对象)
Git的存储单位,它以对象内容的SHA1值做为唯一对象名;因此对象内容是不能被修改的。
object database(对象仓库)
用来存储一组对象(objects),每个对象通过对象名来区别。对象(objects)通常保存在 $GIT_DIR/objects/。
object identifier(对象标识符)
对象名(object name)的同义词。
object name(对象名)
一个对象的唯一标识符(unique identifier)。它是使用SHA1算法(Secure Hash Algorithm 1)给对象内容进行哈希(hash)计算,产生的一个40个字节长的16进制编码的串。
object type(对象类型)
Git有4种对象类型:提交(commit),树(tree),标签(tag)和二进制块(blob)。
octopus(章鱼)
一次多于两个分支的合并(merge)。也用来表示聪明的肉食动物。
默认的上游仓库(upstream repository)。每个项目至少有一个它追踪(track)的上游(upstream)仓库,通常情况 origin 就是用来表示它。你可以用 ”`git branch -r`“ 命令查看上游仓库(upstream repository)里所有的分支,再用 origin/name-of-upstream-branch 的名字来抓取(fetch)远程追踪分支里的内容。
pack(包)
一个文件,里面有一些压缩了的对象。(用以节约空间或是提高传输效率)。
pack index(包索引)
包(pack)里的一些标识符和其它相关信息,用于帮助git快速的访问包(pack)里面的对象。
A commit object contains a (possibly empty) list
of the logical predecessor(s) in the line of development, i.e. its
一个提交对象(commit object),()。
The term pickaxe refers to an option to the diffcore
routines that help select changes that add or delete a given text
string. With the `--pickaxe-all` option, it can be used to view the full
changeset that introduced or removed, say, a
particular line of text. See .
core git的别名(cute name)。
Cute name for programs and program suites depending on
core git, presenting a high level access to
core git. Porcelains expose more of a SCM
interface than the plumbing.
pull(拉)
拉(pull)一个分支意味着,把它抓取(fetch)下来并合并(merge)进当前的分支。可以参考 .
Pushing a branch means to get the branch's
head ref from a remote repository,
find out if it is a direct ancestor to the branch's local
head ref, and in that case, putting all
objects, which are reachable from the local
head ref, and which are missing from the remote
repository, into the remote
object database, and updating the remote
head ref. If the remote head is not an
ancestor to the local head, the push fails.
All of the ancestors of a given commit are said to be
"reachable" from that commit. More
generally, one object is reachable from
another if we can reach the one from the other by a chain
that follows tags to whatever they tag,
commits to their parents or trees, and
trees to the trees or blobs
that they contain.
重新应用(reapply)当前点(branch)和另一个点(base)间的修改;并且根据rebase的结果重置当前分支的 head。
译者注:这个功能可以修改历史提交。
ref(引用)
一个40字节长的SHA1串或是表示某个对象的名字。它们可能存储在 $GIT_DIR/refs/。
reflog用以表示本地的ref的历史记录。从另外一角度也可以说,它能行告诉你这个仓库最近的第3个版本(revision)是什么,还可以告诉你昨天晚上9点14分时你是在这个仓库的哪个分支下工作。可以参见:。
"refspec"用于描述在抓取和推的过程中,远程ref和本地ref之间的映射关系。它用冒号连接::,前面也可以加一个加号:“+“。
例如:git fetch $URL refs/heads/master:refs/heads/origin 意味着:从$URL抓取主分支的 head 并把它保存到本地的origin分支的head中。git push $URL refs/heads/master:refs/heads/to-upstream 意味着:把我本地主分支 head 推到$URL上的 to-upstream分支里。具体可以参见: 。
repository
A collection of refs together with an
object database containing all objects
which are reachable from the refs, possibly
accompanied by meta data from one or more porcelains. A
repository can share an object database with other repositories
via alternates mechanism.
在自动合并失败后,手工修复合并冲突的行为。
revision(版本)
对象仓库(object database)保存的文件和目录在某一特定时间点的状态;它会被一个提交对象(commit object)所引用。
丢弃某一部分开发成果。例如:把head 指向早期的版本。
源代码管理工作。
对象名(object name)的同义词。
shallow repository
A shallow repository has an incomplete
history some of whose commits have parents cauterized away (in other
words, git is told to pretend that these commits do not have the
parents, even though they are recorded in the commit
object). This is sometimes useful when you are interested only in the
recent history of a project even though the real history recorded in the
upstream is much larger. A shallow repository
is created by giving the `--depth` option to , and
its history can be later deepened with .
Symbolic reference: instead of containing the SHA1
id itself, it is of the format 'ref: refs/some/thing' and when
referenced, it recursively dereferences to this reference.
'HEAD' is a prime example of a symref. Symbolic
references are manipulated with the
tag(标签)
一个ref指向一个标签或提交对象。与 head 相反,标签并不会在一次提交操作后改变。标签(不是标签对象)存储在$GIT_DIR/refs/tags/。 一个标签通常是用来标识提交家族链(commit ancerstry chain)里的某一点。
tag object(标签对象)
一个含有指向其它对象的引用(ref)的对象,对象里包括注释消息。如果它里面可以含有一个PGP签名,那么就称为一个“签名标签对象”(signed tag object)。
topic branch
A regular git branch that is used by a developer to
identify a conceptual line of development. Since branches are very easy
and inexpensive, it is often desirable to have several small branches
that each contain very well defined concepts or small incremental yet
related changes.
tracking branch
A regular git branch that is used to follow changes from
another repository. A tracking
branch should not contain direct modifications or have local commits
made to it. A tracking branch can usually be
identified as the right-hand-side ref in a Pull:
一个用以追踪(follow)另外一个仓库的修改的git分支。()
tree(树)
可以是一个工作树(working tree),也可以是一个树对象(tree object)。
tree object(树对象)
包含有一串(list)文件名和模式(mode),并且指向与之相关的二进制对象(blob object)和树对象(tree object)。一个树(tree)等价于一个目录。
tree-ish(树名)
一个指向的提交对象(commit object),树对象(tree object)或是标签对象(tag object)的引用(ref)。
unmerged index(未合并索引)
一个索引中包含有未合并的索引条目(index entries)。
unreachable object(不可达对象)
从任何一个分支、标签或是其它引用(reference)做为起点都无法到达的一个对象。
working tree(工作树)
签出(checkout)用于编辑的文件目录树。 工作树一般等价于 HEAD 加本地没有提交的修改。可能是我们对git不理解,团队合作实际使用中感觉和svn没什么区别,每个人还是 add -& commit -& push到服务器等操作,谁能给讲解下git在使用中对团队实际有什么好处?主要就是分布式和存储方式的?谢谢
10:09:48 +08:00 · 5902 次点击
25 回复 &| &直到
20:43:25 +08:00
& & 10:13:59 +08:00
Git的特色之一是Branch,Git比其他的SCM工具在分支开发上有很大的优势。因为您使用的操作是SCM必备的操作,所以从这个方面确实看不出区别。
& & 10:47:57 +08:00
git正常情况下是一个master分支,然后每人用自己的分支。add-&commit-&push这个行为是没有问题的,但是跟svn的真正区别在fetch和merge上面。例如说有5个人并行开发,其中一个人的提交对你的功能有影响,那么你只需要merge他的分支就好了,其他人的不merge也没问题。如果是在svn上的话,你一做svn up,就所有人的都merge了。另外一个不同的地方就是代码优化之类的工作。有时候我们需要对某些代码进行重构,然后在本地一顿大改,这个时候有个紧急bug需要你去修,然后你会很尴尬的发现你的代码跑不起来了。用git的话你可以在你的本地开分支来做这些事情。优化完了以后自己本地merge完了再把最后结果提交。当然,用svn开分支也可以做到相同的事情,但是svn开分支是整个项目组影响的,要慎重。git的话只是在自己本地折腾而已。
& & 14:08:43 +08:00
code review 也是一个好处,pull request 的机制比各种自造的 svn 轮子要方便优雅许多。另外,你们可以看一下 git flow 和 github flow,也许会有新的发现
& & 15:37:57 +08:00
git 系列视频教程。
& & 15:42:17 +08:00
1. 你可以将自己的工作分成很小的粒度依次commit, 全部改好后,再集中push. 这样很有条理,也不会影响别人。2. 如果你在家里工作,你依然可以commit,到了公司后再push。避免了一股脑儿提交一大堆改动的情况。3. 分支机制的开销很小,用熟了,真是团队合作的利器。
& & 22:04:38 +08:00
推荐阅读这篇文章
& & 22:10:21 +08:00
试一试 github。
& & 22:11:17 +08:00
你没有接触brach吗?git merge起来很棒的~
& & 22:34:57 +08:00
首先git不是用来替代svn的,有可能svn更适合你们目前的需求.相比svn,git的最大优势是它是一个分布式版本管理工具,每个成员可以有一套自己的本地代码,然后把需要部分同步到一个集中服务器中(想像一下用svn你如何版本控制一些不适合提交到中心服务器但又对你有点用的代码)另外还有一种选择是:公司统一用svn,然后有需要的同学自己在本地用git-svn玩.
& & 23:23:13 +08:00
公司集中团队开发跟git上面的协作式开发还是差距很大的,有在公司集中团队开发把git用得淋漓尽致的,不妨可以介绍介绍经验。我在公司也不止一个项目试用过git了,实际操作中你会发现,单纯的4-5个人的一个集中开发的开发团队,几乎完全用不上git的各种所谓的技巧。这估计也是楼主问这个问题的原因。我经常性是一边使用svn,然后一边在svn遇到一些不好处理的问题的时候会去思考如果用git的话会不会好一些,这也就是我前面回复的内容的来源。最有用的莫过于就是本地做代码优化重构或者实验的时候,开一个分支出去做,这样有什么bug要处理的话不至于让自己的开发环境一塌糊涂。集中push貌似很美,其实也就是那么回事。对于那些公司scm管理很严格的,要求一个changeset只做一件事情的话,本地commit,集中push就很有用,要不然其实也有点鸡肋。
& & 09:36:55 +08:00
我也是git初学者,说个体会吧:git 的版本历史是链表, svn 没这个。在 svn 中,从 trunk merge到 branch 需要这么做: trunk&
svn log --limit xx
#拿到最新版本号B
svn info 拿到/trunk/svnpathbranch&
svn log --limit xx
#找到上次merge点的版本号A
svn merge -rA:B /trunk/svnpath
#这还只是merge到本地,还要提交
#提交还要再注释里面记录merge的起止号码
svn ci -m &merge [A:B] from trunk .....&而再git里面一个命令就做完了。git内部管理了分支的版本信息。真正节省了程序员的时间。
& & 09:56:23 +08:00
&分支开发&是核心区别,不习惯于这一流程的话,使用Git意义不大习惯以后会觉得比SVN舒服不是一点点
& & 11:01:50 +08:00
@ &pull request 的机制&, pull request 是 GitHub(以及其他git web app) 特有的功能,不是 git 的功能
& & 11:14:54 +08:00
Git 的精华是branch,也是经验不足的人经常出错的部分。
& & 11:48:11 +08:00
@ 嗯,我应该先把后面那句话提到前面来说
& & 12:18:41 +08:00
团队里的几个人也可以靠Git交换代码。个人在本地可以靠Git实行更细的代码管理。反正SVN有的Git都有,何必再用SVN。Git有一定的学习难度,但是如果只是像SVN一样用,可以做一个用例教程发给每个组员。
& & 14:09:23 +08:00
Git有图形化界面么?实在不想为这点儿事进控制台,SVN的图形化界面很适合懒人啊。
& & 15:59:49 +08:00
你git用习惯了,就发现“分支开发”确实就是精髓。
& & 16:33:12 +08:00
其实Git是加入了社交这个最大的元素,svn只是工具,没有社交。
& & 16:38:07 +08:00
总有一天,Svn服务器会挂掉...到时候你就会发现Git的好...
& & 16:48:24 +08:00
狂开分支,开发的爽。可惜没多少公司用git。
& & 19:40:56 +08:00 via Android
@ git-gui(msysgit自带的工具) ,Tortoisegit
& & 23:10:44 +08:00
我们也是从去年11月开始尝试git的(在此之前野生程序员单人开发,没有任何版本服务器使用经验)我们目前是这样使用的:1 根据开发内容划分branch。这样可以有多个branch同时进行,相互不干扰。不同branch通过hook自动push到不同的域名下以供测试。2 随时commit随时push。这样同一branch下的开发会很少处理文件冲突。3 合并时先把master合并到自己所在的branch,处理完冲突和bug后再合并到master。(如果合并时间超过1天,则递归此条,以防止别的commit或别的branch合并带来的bug)4 master和线上版本保持一致,发现bug后,相关开发人员切到master修复bug,push。测试没有问题后,push到线上。GUI工具 windows用 Tortoisegitmac用source tree目前木有linux用户~
& & 23:34:40 +08:00
如果你不用分支功能,用起来都差不多了。
& & 20:43:25 +08:00
多谢楼上各位,一直是我们没有用好分支...
& · & 791 人在线 & 最高记录 1286 & · &
创意工作者们的社区
Lovingly made by OLIVIDA
VERSION: 3.7.1 · 39ms · UTC 05:52 · PVG 13:52 · LAX 21:52 · JFK 00:52? Do have faith in what you're doing.}

我要回帖

更多关于 git fetch 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信