From Fedora Project Wiki

Cog.png
This page needs some love
This page should be revised or reconstructed to be more helpful. Problems may include being out of step with current team or project status or process.
Warning.png
This page is a draft only
It is still under construction and content may change. Do not rely on the information on this page.
  1. Write some code
  2. Do git-init
  3. To commit, do git-commit
    • Do a short commit message (for first line browsers), then do more details below
      • The newline character is the marking point, the extra line space makes nice formatting
      • git shortlog
  4. git-config --global --list
    • git-config --global user.name "Foo Bar"
  5. git status
  6. git commit -a
    • Tells git to only stage files that have been modified or deleted, but ignores new files
  7. git clone http://katzj.fedorapeople.org/git/fudcontest.git
  8. git commit --interactive
  9. On fedorapeople.org to get an executable: ln -s /usr/bin/git-update-server-info git-update-server-info
  10. git commit test => error: pathspec 'test' did not match any file(s) known to git.
    • == you forgot to add it
    • git status
    • git add test
    • git commit
  11. git pull
    • Only if you have no changes locally
    • Merges changes or forces you to fix (as you go)
    • Shoves the trees together
    • Best practice -- avoid running git pull on anything that is r/w
    • Try a rebase:
    1. git rebase
    2. gitk -- GUI view of the repo
    3. git fetch
    4. git commit --interactive is useful
  12. git branch -- use only to see what branches you have and what you are in

Branching

  1. mkdir foo/ bar/
  2. cd foo/
  3. git (a branch) foo
  4. git (a branch) bar
  1. mkdir livecd-tools.master
  2. git clone ssh://git.fedorahosted.org/git/livecd.git livecd.f9
  3. cd livecd.f9
  4. git clone ssh://git.fedorahosted.org/git/livecd.git livecd.f9
  5. git branchv
  6. get checkout --track origin/f9-branch -b f9-branch


Tips

  • How git talks to itself is how it talks to you
    • Once you understand git talk, you understand git
  • Use fedorapeople.org ACLs to give commit permission
    • As a pre-fedorahosted.org step
  • The program giggle is a graphical viewer, but it's not maintained.
  • Use git commit --interactive to do a patch, if it is three lines away from other unchanged content
  • Use git status before you commit to be sure you are doing what you mean to do
  • git checkout == switch to a branch
  • master == HEAD (basically)