From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Subject: Re: git newbie problems
Date: Wed, 06 Dec 2006 02:23:06 +0100 [thread overview]
Message-ID: <el55to$952$1@sea.gmane.org> (raw)
In-Reply-To: 457611B9.9020907@gmail.com
Graham Percival wrote:
> Greetings,
>
> I'm posting these problems at Han-Wen and Dscho's insistence. I'm the
> documentation editor for GNU/LilyPond, so I'm reluctant to criticize
> other project's documentation unless I spend an hour or more seriously
> reading it. I'm quite willing to admit that I never seriously tried to
> read the docs on the overall theory of git (branches, repo, etc); I just
Branches are very useful concept. And I really like the idea of branches in
git (the underlying concept of branch as lineage) and its implementation.
But because CVS had seriously screwed implementation of branches, you
probably didn't use it.
> flailed around looking for magic commands to make things work. By "make
> things work", I mean imitating my work style with cvs:
Perhaps it would be better to at least read cvs-migration.txt
http://kernel.org/pub/software/scm/git/docs/cvs-migration.html
and all tutorials.
> cvs co blah blah (which I simply copy and paste from savannah)
> while (true) {
> cvs update // get changes that happened overnight
"git pull", or "git fetch". "git pull" is more like in CVS, because it
merges the changes that happened overninght with your work.
> vi foo/bar/baz.txt // or whatever editing commands you do
> make; make web // or whatever testing commands you do
Those steps do not depend on version control used.
> cvs update // get latest changes to prepare for
> // uploading my changes.
> cvs ci foo/bar/baz.txt // upload changes
With git you do this sequence not in braindead CVS "update then commit"
which leads to rare commits (because you don't have time to resolve merge
conflicts for example), but commit then upload changes.
"git commit -a" to commit changes (the standard format of commit message
describing the change expected by history viewers is to write short
one-line description of changes, separate by empty line from longer
description if it is needed (it usually is): see
http://git.or.cz/gitwiki/CommitMessageConventions
(and also other pages on GitDocumentation page at GitWiki as well)).
Then "git push" to propagate your changes (or if you don't have permissions
to push into repository, "git format-patch HEAD^.." and "git send-mail" to
propagate your changes via email).
> }
>
> Once or twice a year I'll do "cvs diff" or "cvs add", but all I really
> want are the above commands. I figured that this should be really easy
> to do, so I kept on skimming through the docs, trying to find the
> equivalent of these really easy commands. (note that I was reading the
> "tutorial introduction to git")
There are some commands which CVS didn't have, and which are very useful
with git: I'm talking here about "git show" (show latest change), "git
log" (show kind of changelog), and gitk (graphical history viewer) or qgit
(alternate graphical history viewer in Qt).
It is also of note that you can move and rename files, soemthing CVS had
much problems with.
> I should add that I've received help on the lilypond-devel list; I'm
> posting this in case it helps future development for git docs, not
> because I need more help to use git.
>
> This case was particularly difficult because the very first time I tried
> to commit... err... push... err... "make my doc changes available to
> everybody else" (whatever the right term is), there was this merge
> problem.
>
>
>
> MERGE PROBLEM
>
> Two people (me and another person) edited the same line on
> Documentation/user/advanced.itely at the same time. (note that this
> file has existed for over a year; it's not a new file) When I tried to
> get the most recent changes, I'm greeted with this:
> ...
> Trying really trivial in-index merge...
> Documentation/user/advanced-notation.itely: needs merge
> fatal: you need to resolve your current index first
> Nope.
> Merging HEAD with c21d3f3e1c77722e50d994763442e6f994b03ac2
> Merging:
> 038b7fc Misc small updates (trying to make git work).
> c21d3f3 Merge branch 'master' of
> ssh+git://hanwen@git.sv.gnu.org/srv/git/lilypond
> found 1 common ancestor(s):
> 84219bb don't have input/templates/ any longer.
> fatal: Entry '.gitignore' would be overwritten by merge. Cannot merge.
> No merge strategy handled the merge.
>
>
> As a git newbie, I'm quite confused. OK, there's no merge strategy...
> so what do I do now? With cvs, the changes would be dumped into the
> file. I look at the file, found the conflict, and tried it again. I
> got the same error message, and then it occurred to me that although I
> changed the files in my ~/usr/src/lilypond, git might be storing these
> files somewhere else.
Yes, the git error messages certainly needs to be made more user-friendly.
What git says here that one version has '.gitignore' file handled by version
control, and second has it outside version control. At least I think what
it does. "git ls-files --unmerged" or "git diff --merge --summary" should
show 'true conflicts'.
By the way, which version of git do you use? I think this particular check
(if it is the case of this error) was relaxed.
> So I tried
> $ git commit Documentation/user/advanced-notation.itely
> Cannot do a partial commit during a merge.
> You might have meant to say 'git commit -i paths...', perhaps?
Hint: usually "git reset" or even "git reset --hard" *warning: the latter
would overwrite your changes since last commit! use with care) is what you
want to do to 'clean up' after some interrupted command.
> ... eh? I'm trying to fix this so that you _can_ merge! Regardless,
> when I tried to update again, I get
>
> $ git pull gnu master
> ...
> Trying really trivial in-index merge...
> fatal: Entry '.gitignore' would be overwritten by merge. Cannot merge.
> Nope.
> Merging HEAD with c21d3f3e1c77722e50d994763442e6f994b03ac2
> Merging:
> 038b7fc Misc small updates (trying to make git work).
> c21d3f3 Merge branch 'master' of
> ssh+git://hanwen@git.sv.gnu.org/srv/git/lilypond
> found 1 common ancestor(s):
> 84219bb don't have input/templates/ any longer.
> fatal: Entry '.gitignore' would be overwritten by merge. Cannot merge.
> No merge strategy handled the merge.
>
>
> Now I'm totally confused, because I definitely haven't touched .gitignore.
I'm guessing that "git add .gitignore", "git commit -a -m
'Added .gitignore'" before retyring pull/push would help in such situation.
> SUGGESTIONS
>
> The "tutorial introduction to git" looks like a nice document, but it
> assumes that you are in control of the project. For users who aren't in
> control (ie me) this is a problem, because it starts me skimming.
> "Importing a project"... nah, that's not me. "Merging branches"... I
> don't care; I'm going to shove everything into the main branch. "Using
> git for collaboration"... hmm, maybe this is the stuff I need to read.
> But by this point, I've already skimmed through five screens of info, so
> I'm not reading very carefully.
>
> It would be nice to have an accompanying "tutorial introduction to
> contributing with git" for users (like me) who are not in control of a
> project.
>
> Finally, it would be really nice if there was some mention of "resolving
> merge problems" in the tutorial (both in the current one and any new
> docs).
Check out "[DRAFT] Branching and merging with git" thread
Message-ID: <20061116221701.4499.qmail@science.horizon.com>
http://permalink.gmane.org/gmane.comp.version-control.git/31625
http://thread.gmane.org/gmane.comp.version-control.git/31625/
which I hope would end as Documentation/tutorial-3.txt. Or you can read jdl
presentation from OLS; check out GitLinks / GitDocumentation at GitWiki:
http://git.or.cz/gitwiki/
> (please CC me as I am not subscribed to the mailist)
I also am not subsribed to the mailing list, but read the list via GMane
NNTP (news, Usenet) interface: see http://git.or.cz/gitwiki/GitCommunity
nntp://news.gmane.org/gmane.comp.version-control.git
P.S. For wuick answers to "what to do now" questions you might use #git
channel on FreeNode.
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
next prev parent reply other threads:[~2006-12-06 1:21 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <4574AC9E.3040506@gmail.com>
[not found] ` <4574BF70.8070100@lilypond.org>
2006-12-06 0:41 ` git newbie problems Graham Percival
2006-12-06 1:23 ` Jakub Narebski [this message]
2006-12-06 9:39 ` Han-Wen Nienhuys
2006-12-06 10:17 ` Jakub Narebski
2006-12-06 10:21 ` Han-Wen Nienhuys
2006-12-06 10:42 ` Johannes Schindelin
2006-12-06 1:35 ` Junio C Hamano
2006-12-06 22:19 ` Daniel Barkalow
2006-12-06 1:52 ` Tom Prince
[not found] ` <el5608$952$2@sea.gmane.org>
2006-12-06 8:01 ` Graham Percival
[not found] ` <45760545.2010801@gmail.com>
[not found] ` <Pine.LNX.4.63.0612060053400.28348@wbgn013.biozentrum.uni-wuerzburg.de>
[not found] ` <45761451.8020006@gmail.com>
[not found] ` <Pine.LNX.4.63.0612060157020.28348@wbgn013.biozentrum.uni-wuerzburg.de>
2006-12-06 9:55 ` git patch Han-Wen Nienhuys
2006-12-06 10:00 ` Junio C Hamano
2006-12-06 10:22 ` Jakub Narebski
[not found] ` <Pine.LNX.4.63.0612061105220.28348@wbgn013.biozentrum.uni-wuerzburg.de>
[not found] ` <457698E0.80207@lilypond.org>
[not found] ` <Pine.LNX.4.63.0612061147540.28348@wbgn013.biozentrum.uni-wuerzburg.de>
2006-12-06 11:27 ` Han-Wen Nienhuys
[not found] ` <20061206.105251.144349770.wl@gnu.org>
2006-12-06 12:27 ` [PATCH] cvs-migration document: make the need for "push" more obvious Johannes Schindelin
2006-12-06 12:32 ` Jakub Narebski
2006-12-06 13:14 ` Johannes Schindelin
2006-12-06 13:27 ` Jakub Narebski
2006-12-06 13:32 ` New users, was " Johannes Schindelin
2006-12-06 14:52 ` J. Bruce Fields
2006-12-06 14:52 ` Han-Wen Nienhuys
2006-12-06 14:58 ` J. Bruce Fields
2006-12-06 15:05 ` Han-Wen Nienhuys
2006-12-06 15:16 ` Johannes Schindelin
2006-12-06 17:19 ` J. Bruce Fields
2006-12-06 17:24 ` J. Bruce Fields
2006-12-06 17:44 ` Junio C Hamano
2006-12-07 4:18 ` [PATCH] Documentation: reorganize cvs-migration.txt J. Bruce Fields
2006-12-07 5:51 ` Junio C Hamano
2006-12-07 15:21 ` J. Bruce Fields
2006-12-07 14:28 ` Johannes Schindelin
2006-12-07 17:43 ` J. Bruce Fields
2006-12-07 17:50 ` Johannes Schindelin
2006-12-08 3:34 ` J. Bruce Fields
2006-12-08 7:25 ` Junio C Hamano
2006-12-09 3:58 ` J. Bruce Fields
2006-12-06 21:02 ` [PATCH] cvs-migration document: make the need for "push" more obvious Graham Percival
2006-12-06 21:45 ` J. Bruce Fields
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='el55to$952$1@sea.gmane.org' \
--to=jnareb@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).