git/list[1] front-page[2] threads[3] people[4] search[5] about
 

new to git

From
Kyle Rose <krose@krose.org>
Date
Aug 27, 2007, 19:43 UTC
Message-ID
<46D32973.8030104@krose.org>

After many years of dissatisfaction with the limitations of CVS, and after getting fed up with the complexity of configuring and maintaining a SVN setup, I just started using git for my own personal projects. I have to say it's quite nice and fits the UNIX philosophy well: fast, simple, powerful.

I've been playing with it for a few weeks and generally understand what is going on, but I do have a few usage questions that I couldn't find answered in the docs:

(1) Let's say I:

git clone something git branch foo git checkout foo <make some changes> git commit -a git checkout master git pull . foo git push git pull

what is actually happening?  The pull appears to do something (i.e., I get:
* refs/remotes/origin/master: fast forward to branch 'master' of
/home/krose/git-repository/baz/
  old..new: 7cf088c..d344f98

), but makes no changes locally since I have the latest revision. Another subsequent git pull does, in fact, say everything is up to date.

(2) Any way to disable this warning:
Warning: No merge candidate found because value of config option
         "branch.local.merge" does not match any remote branch fetched.

(3) I notice I can't reset --hard a single file. So, if I want to revert a single file to some revision, blowing away my changes, what is the accepted way of doing this? Is there a way to do the equivalent of a p4 print foo@some_revision?

(4) I'm still not clear on when a dst should and should not be used in a refspec. It appears that one can only do non-fast forward updates to the branch that is checked out (which makes sense, since you may need to resolve), but other than that, what is the difference between

git checkout foo git pull . master

and

git checkout master git push . master:foo

?

(5) Are there any tools for managing some of the metadata (e.g., the origin URL) or is it expected that one edit it directly?

Thanks for all your work on this: git fills a need I didn't know I had until I actually found myself using it: a completely decentralized patch management system.

Kyle
Next: J. Bruce Fields
Message 1 of 8 in “new to git”
  1. Kyle RoseAug 27, 2007
  2. J. Bruce FieldsAug 27, 2007
  3. Andreas EricssonAug 27, 2007
  4. Kyle RoseAug 27, 2007
  5. Junio C HamanoAug 27, 2007
  6. Andreas EricssonAug 27, 2007
  7. Jan HudecSep 5, 2007
  8. Junio C HamanoSep 5, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.