From Fedora Project Wiki
(interim save) |
(another interim commit during talk) |
||
Line 1: | Line 1: | ||
# Write some code | # Write some code | ||
# Do <code>git-init</code> | # Do <code>git-init</code> | ||
Line 12: | Line 11: | ||
#* Tells git to only stage files that have been modified or deleted, but ignores new files | #* Tells git to only stage files that have been modified or deleted, but ignores new files | ||
# <code>git clone http://katzj.fedorapeople.org/git/fudcontest.git</code> | # <code>git clone http://katzj.fedorapeople.org/git/fudcontest.git</code> | ||
# <code>git commit --interactive</code> | |||
# On fedorapeople.org to get an executable: <code>ln -s /usr/bin/git-update-server-info git-update-server-info</code> | |||
# <code>git commit test => error: pathspec 'test' did not match any file(s) known to git.</code> | |||
#* == you forgot to add it | |||
#* <code>git status</code> | |||
#* <code>git add test</code> | |||
#* <code>git commit</code> | |||
# <code>git pull</code> | |||
#* '''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: | |||
## <code>git rebase</code> | |||
## <code>gitk</code> -- GUI view of the repo | |||
## <code>git fetch</code> | |||
## <code>git commit --interactive</code> is useful | |||
# <code>git branch</code> -- ''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 <code>giggle</code> is a graphical viewer, but it's not maintained. | |||
* Use <code>git commit --interactive</code> to do a patch, if it is three lines away from other unchanged content | |||
* Use <code>git status</code> before you commit to be sure you are doing what you mean to do | |||
* <code>git checkout</code> == switch to a branch | |||
* ''master'' == HEAD (basically) | |||
[[Category:FUDCon10]] [[Category:Draft Documentation]] | [[Category:FUDCon10]] [[Category:Draft Documentation]] |
Revision as of 16:12, 21 June 2008
- 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)