Git Exp.

By | 2013年4月8日

Supposing that you had a git server, we can use exist git as your own working bare.

[On your own git server] Create a repo.
Clone an exist git.

Make its master branch writable.

[On your client] Create a branch & make a change.
Clone exist.git as your own git-src, in which you can see the old commits and branch.

We create a new branch based on its master.

Since this is our first commit, we should push our branch to origin. Next time you should just type ‘git push’

[On your own git server] An update in master.
Let’s get some new commits.

Here we get something like this…

Now we get commit0 and commitA on mybranch, with commit0 and commit1 on branch master.
What we want is something like this.

[On your client] Merge commit1 to mybranch
Way 1.Just merge them from your own git server

Way 2.Pull commit1 to local master, then rebase or merge it to mybranch


Final step:

There’s a little difference between merge and rebase in history.