$ cd sayings $ git branch release-0.1
That's it.
Check where we are:
$ git branch * master release-0.1 $ git status # On branch master nothing to commit (working directory clean)
$ git checkout release-0.1 Switched to branch 'release-0.1'
Check where we are:
$ git branch master * release-0.1 $ git status # On branch release-0.1 nothing to commit (working directory clean)
Bug fix in 0.1
$ vim northern.txt
Ay up
Ee bah gum
Were tha born in a barn?
$ git commit -a -m "Fix gum spelling"[release-0.1 100c9bd] Fix gum spelling 1 file changed, 1 insertion(+), 1 deletion(-)
$ git checkout master Switched to branch 'master' $ cat northern.txt Ay up Eey by gum Were tha born in a barn?
Development work in trunk
$ vim northern.txt
Ay up
Eey by gum
Were tha born in a barn?
Yer not as green as yer cabbage looking
$ git commit -a -m "Add cabbage saying"[master aa3b4a5] Add cabbage saying 1 file changed, 1 insertion(+), 1 deletion(-)
Ensure we have no uncommitted changes:
$ git status # On branch master nothing to commit (working directory clean)
Then do it:
$ git merge release-0.1
Merge branch 'release-0.1' # Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
Then do it:
$ git merge release-0.1Auto-merging northern.txt Merge made by the 'recursive' strategy. northern.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Result:
$ cat northern.txt Ay up Ee bah gum Were tha born in a barn? Yer not as green as yer cabbage looking
More complex merges:
$ git merge release-0.1Auto-merging pirate.txt CONFLICT (add/add): Merge conflict in pirate.txt Automatic merge failed; fix conflicts and then commit the result.$ git mergetool
Another time...
$ gitk
Videos | youtube.com/user/ajbalaam |
---|---|
@andybalaam | |
Blog | artificialworlds.net/blog |
Projects | artificialworlds.net |