Re: Problems with branches
Hi,
On Fri, 26 Jan 2007, John Rigby wrote:
Show 23 quoted lines
> I'm having trouble doing something so simple that it is in the
> tutorial but for some reason it does not work for me.
> The following script does basically the same thing that is
> outlined in the "Managing branches" section of the tutorial.
>
> mkdir foodir
> cd foodir/
> git-init-db
> echo bar > bar
> git-add bar
> git-commit -m "Initial bar"
> git-branch mybranch
> git-branch
> git-checkout mybranch
> echo bar2 >> bar
> git-commit -a -m "Added line bar2 to bar in mybranch"
> git-checkout master
> cat bar
> echo bar3 >> bar
> git-commit -a -m "Added line bar3 to bar in master"
> git-commit -a
> git-diff master mybranch
> git-merge mybranch
What version do you run? I get this running your script:
$ mkdir foodir
$ cd foodir/
$ git-init-db
Initialized empty Git repository in .git/
$ echo bar > bar
$ git-add bar
$ git-commit -m "Initial bar"
Created initial commit bca2eed2306297ec17abb5a9a9fd916f18bdd7f8
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 bar
$ git-branch mybranch
$ git-branch
* master
mybranch
$ git-checkout mybranch
$ echo bar2 >> bar
$ git-commit -a -m "Added line bar2 to bar in mybranch"
Created commit 48c9ce01b39faabc778bcc2ca52f44db54670809
1 files changed, 1 insertions(+), 0 deletions(-)
$ git-checkout master
$ cat bar
bar
$ echo bar3 >> bar
$ git-commit -a -m "Added line bar3 to bar in master"
Created commit 496e810b70c3dba56d002ad9bec61028af7de821
1 files changed, 1 insertions(+), 0 deletions(-)
$ git-commit -a
# On branch master
nothing to commit (working directory clean)
$ git-diff master mybranch
diff --git a/bar b/bar
index 77914eb..46ffc55 100644
--- a/bar
+++ b/bar
@@ -1,2 +1,2 @@
bar
-bar3
+bar2
$ git-merge mybranch
Auto-merged bar
CONFLICT (content): Merge conflict in bar
Automatic merge failed; fix conflicts and then commit the result.