Chinaunix首页 | 论坛 | 博客
  • 博客访问: 183081
  • 博文数量: 34
  • 博客积分: 869
  • 博客等级: 准尉
  • 技术积分: 375
  • 用 户 组: 普通用户
  • 注册时间: 2012-03-08 15:55
文章分类

全部博文(34)

文章存档

2012年(34)

我的朋友

分类: 项目管理

2012-03-29 16:22:42

Distributed workflows

suppose that alice has started a new project with a git repository in /local/alice/project and that Bob who has a home directory on the same machine want to contribute.

Bob begin with


点击(此处)折叠或打开

  1. git clone /local/alice/project myproject
create a new directory myproject containing a clone if alices's repository. The clone is on an equal footing with original project.

Bod then edit the files and git commit them;

when he is ready, he tells alice to pull changes from the repository at /local/bob/myproject she does this with

点击(此处)折叠或打开

  1. git pull /local/bob/myproject master
this merges the changes from the bob's master branch into alice current branch then she may need to manually fix any conflicts (note that's master argument in the above command is actually unnecessary,as it is the default)

the pull command thus performs two operations: it fetches changes from a remote branch, then merges them into the current branch。when you are working in a small closely knit group, it is not unusual to interact with the same repository over and over again, by defining 'remote ' repository shorthand, you can make it easy.


点击(此处)折叠或打开

  1. git remote add bob /local/bob/myproject
with this alice can perform the git fetch bob to get the changes

unlike long hand form, when alice fetches from bob using a remote repository shorthand set up with git remote what was fetched is stored in a remote tracking branch, in this case bob/master . So after this


点击(此处)折叠或打开

  1. git log -p master ..bob/master

shows list of all the changes that bob made since he branched from alice's master branch.

After examing those changes, alice could merge the changes into her master branch


点击(此处)折叠或打开

  1. git merge /bob/master or git pull . remotes/bob/master

then bob could used the git pull to sync the alice any changes






阅读(583) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~