From Fedora Project Wiki
- Write some code
- Do
git-init
- 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
- Do a short commit message (for first line browsers), then do more details below
git-config --global --list
git-config --global user.name "Foo Bar"
git status
git commit -a
- Tells git to only stage files that have been modified or deleted, but ignores new files
git clone http://katzj.fedorapeople.org/git/fudcontest.git
git commit --interactive
- On fedorapeople.org to get an executable:
ln -s /usr/bin/git-update-server-info git-update-server-info
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
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:
git rebase
gitk
-- GUI view of the repogit fetch
git commit --interactive
is useful
git branch
-- use only to see what branches you have and what you are in
Branching
- mkdir foo/ bar/
- cd foo/
- git (a branch) foo
- git (a branch) bar
- mkdir livecd-tools.master
- git clone ssh://git.fedorahosted.org/git/livecd.git livecd.f9
- cd livecd.f9
- git clone ssh://git.fedorahosted.org/git/livecd.git livecd.f9
- git branchv
- 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)