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

Re: [PATCH] Simplified GIT usage guide

From
Miklos Vajna <vmiklos@frugalware.org>
Date
Dec 12, 2008, 18:53 UTC
Message-ID
<20081212185347.GK5691@genesis.frugalware.org>
In-Reply-To
<20081212182827.28408.40963.stgit@warthog.procyon.org.uk>
On Fri, Dec 12, 2008 at 06:28:27PM +0000, David Howells <dhowells@redhat.com> wrote:
> + (1) File objects.
> +
> +     A file object contains the contents of a source file and the attributes of
> +     that file (such as file mode).

This is incorrect, a 'blob' contains only the contents of the blob, the file mode is stored in the 'tree' object.

Show 24 quoted lines
> + (2) Directory objects.
> +
> +     A directory object contains the attributes of that directory plus a list
> +     of file and directory objects that are members of this directory.  The
> +     list includes the names of the entries within that directory and the
> +     object ID of each object.
> +
> + (3) Commit objects.
> +
> +     A commit object contains the attribute of that commit (the author and the
> +     date for instance), a textual description of the change imposed by that
> +     commit as provided by the committer, a list of object IDs for the commits
> +     on which this commit is based, and the object ID of the root directory
> +     object representing the result of this commit.
> +
> +     Note that a commit does not literally describe the changes that have been
> +     made in the way that, say, a diff file does; it merely carries the current
> +     state of the sources after that change, and points to the commits that
> +     describe the state of the sources before that change.  GIT's tools then
> +     infer the changes when asked.
> +
> +     A commit object will typically refer to one base commit when someone has
> +     merely committed some changes on top of the current state, and two base
> +     commits when a couple of trees have been merged.
Is there any reason you hide the tag object?
Show 12 quoted lines
> +where %HOUR is the hour you want it to go off every day.  For my local mirror
> +of Linus's upstream kernel, I use:
> +
> +	#!/bin/sh
> +	cd /warthog/git/linux-2.6 || exit $?
> +	exec git pull >/tmp/git-pull.log
> +
> +and:
> +
> +	0 6 * * *       /home/dhowells/bin/do-git-pull.sh
> +
> +which will do the update every day at 6am.
Using git clone --mirror would be much efficient, I think.
> +The "-l" tells git clone that the source (mirror) repository is on the local
> +machine, that it shouldn't go over the internet for it, and that it should
> +hardlink GIT objects from the source repository rather than copying them where
> +possible.
Here and later below, IIRC -l is the default for local clones.
> +	cd /my/git/trees
> +	git clone -n --bare %UPSTREAM_REPO %MY_DIR
--bare implies -n.
Show 14 quoted lines
> +If you haven't yet committed your changes, you'll have to siphon them off into
> +a file:
> +
> +	git diff >a.diff
> +
> +and deapply them:
> +
> +	patch -p1 -R <a.diff
> +
> +You can then update your tree from the upstream tree with no fear of a conflict
> +(assuming you don't also have changes that you have committed).  Once you've
> +updated your tree, you can reapply your changes:
> +
> +	patch -p1 <a.diff
Why not using git stash and git stash pop?

Or at least git apply and git checkout - leaving out patch(1) from the game.

Previous: David HowellsNext: David Howells
Message 2 of 38 in “Simplified GIT usage guide”
  1. Simplified GIT usage guideDavid Howells, Dec 12, 2008
  2. Miklos VajnaDec 12, 2008
  3. David HowellsDec 12, 2008
  4. Miklos VajnaDec 12, 2008
  5. David HowellsDec 13, 2008
  6. Miklos VajnaDec 13, 2008
  7. Johannes SchindelinDec 12, 2008
  8. David HowellsDec 12, 2008
  9. Sverre RabbelierDec 12, 2008
  10. Aidan Van DykDec 12, 2008
  11. Nick AndrewDec 13, 2008
  12. Ping YinDec 14, 2008
  13. Paul E. McKenneyDec 19, 2008
  14. Junio C HamanoDec 19, 2008
  15. Paul E. McKenneyDec 19, 2008
  16. valdis.kletnieks@vt.eduDec 24, 2008
  17. Johannes SchindelinDec 19, 2008
  18. Paul E. McKenneyDec 19, 2008
  19. Jakub NarebskiDec 12, 2008
  20. David HowellsDec 13, 2008
  21. Sverre RabbelierDec 13, 2008
  22. Willy TarreauDec 19, 2008
  23. Nicolas PitreDec 13, 2008
  24. J. Bruce FieldsDec 12, 2008
  25. J. Bruce FieldsDec 13, 2008
  26. David HowellsDec 13, 2008
  27. Jeff GarzikDec 12, 2008
  28. Chris FriesenDec 12, 2008
  29. David HowellsDec 13, 2008
  30. Junio C HamanoDec 13, 2008
  31. Nick AndrewDec 13, 2008
  32. Nicolas PitreDec 12, 2008
  33. Junio C HamanoDec 13, 2008
  34. Matthieu MoyDec 14, 2008
  35. Marcin SlusarzDec 14, 2008
  36. C. Scott AnanianDec 19, 2008
  37. Michael J GruberDec 19, 2008
  38. C. Scott AnanianDec 19, 2008

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.