[git-users] Re: Need Help - CONFLICT (add/add)

2010-10-13 Thread Ken
Great!

Thank you!

Ken

On Oct 13, 10:15 am, Konstantin Khomoutov  wrote:
> On Oct 13, 9:05 pm, Ken  wrote:
>
> > Well, not "the same" but that my changes have been merged...
>
> Depends on what you will consider as being merged, really.
> This is because you're free to stuff the conflicting file using any
> contents you want and then commit this.
> So you can verify the state just by peering into the files which were
> merged.
> Also you could do
> $ git diff HEAD^
> to see the diff between the HEAD and the first parent of the HEAD
> (which is the HEAD's state prior to merge).

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: Need Help - CONFLICT (add/add)

2010-10-13 Thread Konstantin Khomoutov
On Oct 13, 9:05 pm, Ken  wrote:

> Well, not "the same" but that my changes have been merged...
Depends on what you will consider as being merged, really.
This is because you're free to stuff the conflicting file using any
contents you want and then commit this.
So you can verify the state just by peering into the files which were
merged.
Also you could do
$ git diff HEAD^
to see the diff between the HEAD and the first parent of the HEAD
(which is the HEAD's state prior to merge).

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: Need Help - CONFLICT (add/add)

2010-10-13 Thread Ken
Actually, the commands I listed in my previous email seemed to do the
job.

Thank you again for all of your help!!

Ken



On Oct 13, 10:08 am, Konstantin Khomoutov  wrote:
> On Oct 13, 8:44 pm, Ken  wrote:> Thank you very much for 
> your help Konstantin!!  I submitted the first
> > command:
>
> > git checkout --theirs public/images/NewMexico_jul_1.jpg
>
> > And received the following error:
>
> > error: pathspec 'public/images/NewMexico_jul_1.jpg' did not match any
> > file(s) known to git.
>
> > Ideas?
>
> No immediate idea.
> Could you do
> $ git reset --hard HEAD
> (this will bring you to the pre-merging state)
> and repeat the merge?

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: Need Help - CONFLICT (add/add)

2010-10-13 Thread Konstantin Khomoutov
On Oct 13, 8:44 pm, Ken  wrote:
> Thank you very much for your help Konstantin!!  I submitted the first
> command:
>
> git checkout --theirs public/images/NewMexico_jul_1.jpg
>
> And received the following error:
>
> error: pathspec 'public/images/NewMexico_jul_1.jpg' did not match any
> file(s) known to git.
>
> Ideas?
No immediate idea.
Could you do
$ git reset --hard HEAD
(this will bring you to the pre-merging state)
and repeat the merge?

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: Need Help - CONFLICT (add/add)

2010-10-13 Thread Ken
Well, not "the same" but that my changes have been merged...

K



On Oct 13, 10:04 am, Ken  wrote:
> Thank you for the detailed explanation.  I appreciate it.
>
> I did the following and it seemed to work:
>
> git checkout add_articles public/images/NewMexico_jul_1.jpg
> git add public/images/NewMexico_jul_1.jpg
> git commit
>
> Is there some way I can compare the "master" branch with the
> "add_articles" branch to validate that they are indeed the same?
>
> Thanks, Ken
>
> On Oct 13, 9:58 am, Konstantin Khomoutov  wrote:
>
>
>
> > On Oct 13, 8:10 pm, Ken  wrote:
>
> > > I need some help.  I have two branches: "master" and "add_articles".
> > > I've been doing my work in add_articles and I wanted to merge the
> > > changes in to master prior to doing a deploy of my application.
> > > Here's the sequence of events:
> > > git merge add_articles - gave me this error:
> > > warning: Cannot merge binary files: HEAD:public/images/
> > > NewMexico_jul_1.jpg vs. add_articles:public/images/NewMexico_jul_1.jpg
>
> > [...]
>
> > Well, I think I failed to explain the general idea in a clear way, so
> > let's do that in another post.
> > To resolve a conflict, you have to:
> > 1) Make sure the file has sensible contents and it is in the
> > "resolved" state from the "human" (yours) point of view.
> > 2) Make sure that file is resolved from the Git's point of view.
>
> > Step (2) is the simplest -- just git-add the file. That's what Git
> > hints you about when you run git-status while resolving the conflict.
>
> > Step (1) is harder to perform.
> > First, when dealing with text files, in case of a conflict, Git
> > replaces conflicting parts of the file with sets of chunks ("theirs"
> > and "ours") delimited by special conflict markers. This provides for
> > easy comparison of conflicting bits, but at the same time it means
> > it's absolutely pointless to git-add such a file until its contents is
> > manually tweaked and conflicting markers and unneded pieces removed.
> > For binary files, Git can't do the same thing, so it just raises its
> > hands leaving the "ours" contents of that file intact. Now, in theory,
> > you can compare both versions of such files using some tool specific
> > to their format, if such tool exists, and somehow actually merge the
> > changes. But usually one just decides which of the two versions is
> > "actual" and now there's the need to update the file's contents to
> > that version.
> > For this you use git-checkout which is "overloaded" to perform a
> > couple of different tasks -- with updating contents of specific files
> > being one of them.
> > To specify the version you need you either use old
> > voodoo :STAGE:FILENAME syntax or more recent and more conveinent --
> > theirs and --ours options.
>
> > You can read up on that syntax involving stage numbers in the git-rev-
> > parse manual page ("SPECIFYING REVISIONS" section).

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: Need Help - CONFLICT (add/add)

2010-10-13 Thread Ken
Thank you for the detailed explanation.  I appreciate it.

I did the following and it seemed to work:

git checkout add_articles public/images/NewMexico_jul_1.jpg
git add public/images/NewMexico_jul_1.jpg
git commit


Is there some way I can compare the "master" branch with the
"add_articles" branch to validate that they are indeed the same?

Thanks, Ken


On Oct 13, 9:58 am, Konstantin Khomoutov  wrote:
> On Oct 13, 8:10 pm, Ken  wrote:
>
> > I need some help.  I have two branches: "master" and "add_articles".
> > I've been doing my work in add_articles and I wanted to merge the
> > changes in to master prior to doing a deploy of my application.
> > Here's the sequence of events:
> > git merge add_articles - gave me this error:
> > warning: Cannot merge binary files: HEAD:public/images/
> > NewMexico_jul_1.jpg vs. add_articles:public/images/NewMexico_jul_1.jpg
>
> [...]
>
> Well, I think I failed to explain the general idea in a clear way, so
> let's do that in another post.
> To resolve a conflict, you have to:
> 1) Make sure the file has sensible contents and it is in the
> "resolved" state from the "human" (yours) point of view.
> 2) Make sure that file is resolved from the Git's point of view.
>
> Step (2) is the simplest -- just git-add the file. That's what Git
> hints you about when you run git-status while resolving the conflict.
>
> Step (1) is harder to perform.
> First, when dealing with text files, in case of a conflict, Git
> replaces conflicting parts of the file with sets of chunks ("theirs"
> and "ours") delimited by special conflict markers. This provides for
> easy comparison of conflicting bits, but at the same time it means
> it's absolutely pointless to git-add such a file until its contents is
> manually tweaked and conflicting markers and unneded pieces removed.
> For binary files, Git can't do the same thing, so it just raises its
> hands leaving the "ours" contents of that file intact. Now, in theory,
> you can compare both versions of such files using some tool specific
> to their format, if such tool exists, and somehow actually merge the
> changes. But usually one just decides which of the two versions is
> "actual" and now there's the need to update the file's contents to
> that version.
> For this you use git-checkout which is "overloaded" to perform a
> couple of different tasks -- with updating contents of specific files
> being one of them.
> To specify the version you need you either use old
> voodoo :STAGE:FILENAME syntax or more recent and more conveinent --
> theirs and --ours options.
>
> You can read up on that syntax involving stage numbers in the git-rev-
> parse manual page ("SPECIFYING REVISIONS" section).

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: Need Help - CONFLICT (add/add)

2010-10-13 Thread Konstantin Khomoutov
On Oct 13, 8:10 pm, Ken  wrote:

> I need some help.  I have two branches: "master" and "add_articles".
> I've been doing my work in add_articles and I wanted to merge the
> changes in to master prior to doing a deploy of my application.
> Here's the sequence of events:
> git merge add_articles - gave me this error:
> warning: Cannot merge binary files: HEAD:public/images/
> NewMexico_jul_1.jpg vs. add_articles:public/images/NewMexico_jul_1.jpg
[...]

Well, I think I failed to explain the general idea in a clear way, so
let's do that in another post.
To resolve a conflict, you have to:
1) Make sure the file has sensible contents and it is in the
"resolved" state from the "human" (yours) point of view.
2) Make sure that file is resolved from the Git's point of view.

Step (2) is the simplest -- just git-add the file. That's what Git
hints you about when you run git-status while resolving the conflict.

Step (1) is harder to perform.
First, when dealing with text files, in case of a conflict, Git
replaces conflicting parts of the file with sets of chunks ("theirs"
and "ours") delimited by special conflict markers. This provides for
easy comparison of conflicting bits, but at the same time it means
it's absolutely pointless to git-add such a file until its contents is
manually tweaked and conflicting markers and unneded pieces removed.
For binary files, Git can't do the same thing, so it just raises its
hands leaving the "ours" contents of that file intact. Now, in theory,
you can compare both versions of such files using some tool specific
to their format, if such tool exists, and somehow actually merge the
changes. But usually one just decides which of the two versions is
"actual" and now there's the need to update the file's contents to
that version.
For this you use git-checkout which is "overloaded" to perform a
couple of different tasks -- with updating contents of specific files
being one of them.
To specify the version you need you either use old
voodoo :STAGE:FILENAME syntax or more recent and more conveinent --
theirs and --ours options.

You can read up on that syntax involving stage numbers in the git-rev-
parse manual page ("SPECIFYING REVISIONS" section).

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: Need Help - CONFLICT (add/add)

2010-10-13 Thread Ken
Thank you very much for your help Konstantin!!  I submitted the first
command:

git checkout --theirs public/images/NewMexico_jul_1.jpg

And received the following error:

error: pathspec 'public/images/NewMexico_jul_1.jpg' did not match any
file(s) known to git.

Ideas?

Thanks, Ken

On Oct 13, 9:33 am, Konstantin Khomoutov  wrote:
> On Oct 13, 8:10 pm, Ken  wrote:
>
>
>
>
>
> > I need some help.  I have two branches: "master" and "add_articles".
> > I've been doing my work in add_articles and I wanted to merge the
> > changes in to master prior to doing a deploy of my application.
> > Here's the sequence of events:
>
> > git branch - showed the active branch to be add_articles
>
> > git checkout master - switched the active branch to master
>
> > git merge add_articles - gave me this error:
>
> > warning: Cannot merge binary files: HEAD:public/images/
> > NewMexico_jul_1.jpg vs. add_articles:public/images/NewMexico_jul_1.jpg
>
> > Auto-merging app/views/layouts/two_column.html.erb
> > Auto-merging public/images/NewMexico_jul_1.jpg
> > CONFLICT (add/add): Merge conflict in public/images/
> > NewMexico_jul_1.jpg
> > Automatic merge failed; fix conflicts and then commit the result.
>
> > I wasn't sure what to do so I tried deleting the NewMexico_jul_1.jpg
> > file from the public/images directory in master.  That didn't work.  I
> > got the following message:
>
> > fatal: You are in the middle of a conflicted merge.
>
> > I tried doing a "git rm" command to remove the jpg file and got this
> > message:
>
> > public/images/NewMexico_jul_1.jpg: needs merge
>
> > I'm totally stuck.  Can someone tell me how to proceed?
>
> Use git-checkout with either --theirs on --ours command line option
> for the conflicting file to get its contents set to either that of its
> copy in the add_articles branch ("theirs", that is, "what's being
> merged") or to that of its copy on the current branch ("ours"). Then
> follow the update with git-add for that file to push the content you
> deem to be correct to the index and hence prepare it for commit.
> That is, if you want to replace the file by its copy from the branch
> being merged, do this:
> $ git checkout --theirs public/images/NewMexico_jul_1.jpg
> $ git add public/images/NewMexico_jul_1.jpg
> $ git commit
>
> I've recorded a sample session which simulates what you should have
> done here:http://pastebin.com/RucCgDAZ

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: Need Help - CONFLICT (add/add)

2010-10-13 Thread Konstantin Khomoutov
On Oct 13, 8:10 pm, Ken  wrote:

> I need some help.  I have two branches: "master" and "add_articles".
> I've been doing my work in add_articles and I wanted to merge the
> changes in to master prior to doing a deploy of my application.
> Here's the sequence of events:
>
> git branch - showed the active branch to be add_articles
>
> git checkout master - switched the active branch to master
>
> git merge add_articles - gave me this error:
>
> warning: Cannot merge binary files: HEAD:public/images/
> NewMexico_jul_1.jpg vs. add_articles:public/images/NewMexico_jul_1.jpg
>
> Auto-merging app/views/layouts/two_column.html.erb
> Auto-merging public/images/NewMexico_jul_1.jpg
> CONFLICT (add/add): Merge conflict in public/images/
> NewMexico_jul_1.jpg
> Automatic merge failed; fix conflicts and then commit the result.
>
> I wasn't sure what to do so I tried deleting the NewMexico_jul_1.jpg
> file from the public/images directory in master.  That didn't work.  I
> got the following message:
>
> fatal: You are in the middle of a conflicted merge.
>
> I tried doing a "git rm" command to remove the jpg file and got this
> message:
>
> public/images/NewMexico_jul_1.jpg: needs merge
>
> I'm totally stuck.  Can someone tell me how to proceed?

Use git-checkout with either --theirs on --ours command line option
for the conflicting file to get its contents set to either that of its
copy in the add_articles branch ("theirs", that is, "what's being
merged") or to that of its copy on the current branch ("ours"). Then
follow the update with git-add for that file to push the content you
deem to be correct to the index and hence prepare it for commit.
That is, if you want to replace the file by its copy from the branch
being merged, do this:
$ git checkout --theirs public/images/NewMexico_jul_1.jpg
$ git add public/images/NewMexico_jul_1.jpg
$ git commit

I've recorded a sample session which simulates what you should have
done here: http://pastebin.com/RucCgDAZ

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.