Git

From ArchWiki
Revision as of 13:58, 5 March 2011 by Markg85 (Talk | contribs)

Jump to: navigation, search

Tango-document-new.pngThis article is a stub.Tango-document-new.png

Notes: please use the first argument of the template to provide more detailed indications. (Discuss in Talk:Git#)
Summary help replacing me
Installing and using the Git VCS
Related
Super Quick Git Guide: Generally about contributing to pacman, although it still serves as a practical Git tutorial

Merge-arrows-2.pngThis article or section is a candidate for merging with Gitweb.Merge-arrows-2.png

Notes: please use the second argument of the template to provide more detailed indications. (Discuss in Talk:Git#)
Note: Merge note. Gitweb contains parts to clone over http, ssh and the git protocol but those should be here in my opinion. What do you think?

Git is the version control system (VCS) coded by Linus Torvalds (the creator of Linux) when he was criticized for using the proprietary BitKeeper with the Linux kernel. Git is now used by the Linux kernel and by many other projects, including Pacman, Arch's package manager.

Gitk

If you get launching git's GUI gitk like

/usr/bin/gitk: line 3: exec: wish: not found.

you should make sure that tk is installed.

Bash Completion

To add command completion for bash download the following file: git-completion.bash. Then edit your .bashrc file so that it contains the following line:

source git-completion.bash

Cheatsheet

Parts from everywhere, much from the wonderful tutorial here: http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html

Additionally see Super Quick Git Guide.

Pull the network scripts with

git clone http://archlinux.org/~james/projects/network.git

Update an existing clone

git pull origin

Commit changes

git commit -a -m "changelog message"

To create a new branch

git branch somebranch

Change to a different branch

git checkout differentbranch

Merge a branch to current active branch

git merge somebranch

Delete a branch

git branch -d somebranch

Diff between two branches

git diff master..somebranch

Diff between two commit ID's (found in git log)

git diff e9780c7cba2855350e914fde227a79bb63c1351d..8b014e40346b38b3b9bfc41359b4e8a68e804c0d

Diff between the last two commits

git diff HEAD^ HEAD

Patchset between two branches (follows same syntax as git diff afaik)

git format-patch master..somebranch

Or better: http://wiki.winehq.org/GitWine#head-f7a29e7ed999b5924748a60c5a1cd4a019032d26

git format-patch -o out origin

Set nano as default editor

git config --global core.editor "nano -w"

Start remote repository http://www.adeal.eu/starting-with-git.php [broken as of 31DEC10]