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

Re: as promised, docs: git for the confused

From
Junio C Hamano <junkio@cox.net>
Date
Dec 9, 2005, 23:23 UTC
Message-ID
<7vmzj9zwfu.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20051209215414.14072.qmail@science.horizon.com>
linux@horizon.com writes:
> Some users want to track someone else's repository.
> Others...

Exactly. That's why task oriented list would be most useful. Here is a starter.

Everyday GIT Cheat Sheet Or Git With 20 Commands ================================================

Repository Administration -------------------------

  * "init-db" or "clone" to create the initial repository.
  * hooks.
    - public accessible via dumb protocols: need
      update-server-info in hooks/post-update
    - CVS style shared repository: see howto/update-hook-example
      for ideas on branch head policy
  * "fsck-objects", "repack" and "prune".

Individual Developer --------------------

Standalone tasks
  * "show-branch" or "gitk" to see where you are.
  * "diff" or "status" to see what you are in the middle of.
  * "log" to see what happened.
  * "whatchanged" to find out where things come from.
  * "checkout" and "checkout -b" to switch branches.
  * "commit" to advance the current branch head.
  * "reset" to undo unpublished changes.
  * "checkout -- path" to undo working tree chanegs.
  * "pull ." to merge between branches.
  * "rebase" to maintain topic branches.
  * "fsck-objects", "repack" and "prune".
Working as a participant
  * all the commands useful for standalone individual developer tasks.
  * "pull origin" to keep up-to-date.
  * "push upstream" in CVS style shared repository workflow.
  * "format-patch" in kernel style public forum workflow.

Integrator ----------

  * all the commands useful for standalone individual developer tasks.
  * "am" to apply patches.
  * "pull somewhere-else" to merge from trusted lieutenants.
  * "format-patch" to send suggested alternative to contributors.
  * "revert" to undo botched changes.
  * "push public" to publish the results.

It might be surprising that only handful commands are of everyday use among 100+, but the ones listed above are the only ones I use every day. The exact number depends on how you count multi-purpose commands like "checkout" and "pull", but only these need to be learned to play all roles listed above.

	am
	checkout
	checkout -- path
	checkout -b
	commit
	diff
	fetch
	format-patch
	fsck-objects
	gitk
	init-db
	log
	prune
	pull .
	pull other
	push
	rebase
	repack
	reset
	revert
	show-branch
	status
	whatchanged
Previous: linux@horizon.comNext: Linus Torvalds
Message 7 of 28 in “Re: as promised, docs: git for the confused”
  1. linux@horizon.comDec 9, 2005
  2. Petr BaudisDec 9, 2005
  3. linux@horizon.comDec 9, 2005
  4. Randy.DunlapDec 9, 2005
  5. Junio C HamanoDec 9, 2005
  6. linux@horizon.comDec 9, 2005
  7. Junio C HamanoDec 9, 2005
  8. Linus TorvaldsDec 12, 2005
  9. Timo HirvonenDec 12, 2005
  10. Linus TorvaldsDec 12, 2005
  11. Randal L. SchwartzDec 12, 2005
  12. Joshua N PritikinDec 13, 2005
  13. Randal L. SchwartzDec 13, 2005
  14. Junio C HamanoDec 13, 2005
  15. Linus TorvaldsDec 13, 2005
  16. H. Peter AnvinDec 13, 2005
  17. Junio C HamanoDec 13, 2005
  18. Randal L. SchwartzDec 13, 2005
  19. Tip of the day: archaeologyJunio C Hamano, Dec 13, 2005
  20. Linus TorvaldsDec 13, 2005
  21. Junio C HamanoDec 13, 2005
  22. Junio C HamanoDec 12, 2005
  23. Everyday: some examples.Junio C Hamano, Dec 13, 2005
  24. Petr BaudisDec 9, 2005
  25. linux@horizon.comDec 9, 2005
  26. Junio C HamanoDec 10, 2005
  27. Junio C HamanoDec 10, 2005
  28. linux@horizon.comDec 10, 2005

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.