Changes for page Getting Started with Git

Last modified by Bastian Triller on 2013/05/21 17:24

From version 206.1
edited by David Avendasora
on 2011/11/03 01:23
Change comment: There is no comment for this version
To version 211.1
edited by Ray Kiddy
on 2012/09/13 01:19
Change comment: checking out of stash. very cool!

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.avendasora
1 +XWiki.kiddyr
Content
... ... @@ -3,9 +3,6 @@
3 3  = Got Git? No? Get Git =
4 4  
5 5  * Official Download Site: [[http://git-scm.com/download]]
6 -* Direct Download Links:
7 -** MacOS X [[.dmg Binary Installers>>http://code.google.com/p/git-osx-installer/]]
8 -** Microsoft Windows [[.exe Binary Installers>>http://code.google.com/p/msysgit/]]
9 9  
10 10  {{info title="Git is included with XCode 4.x"}}
11 11  
... ... @@ -20,7 +20,7 @@
20 20  ** [[This>>http://www.eecs.harvard.edu/~~cduan/technical/git/]] is an excellent tutorial on the basic concepts behind Git
21 21  ** [[Git for Computer Scientists>>http://eagain.net/articles/git-for-computer-scientists/]] gives another good view on the underlying concepts
22 22  * Learn the basics.
23 -** [[Everyday GIT With 20 Commands Or So>>http://www.kernel.org/pub/software/scm/git/docs/everyday.html]]
20 +** [[Everyday GIT With 20 Commands Or So>>http://schacon.github.com/git/everyday.html]]
24 24  ** [[Free Online Pro Git book>>http://progit.org/book/]]
25 25  *** There is even a free epub version for your iPad/iPhone [[https://github.s3.amazonaws.com/media/progit.epub]]
26 26  
... ... @@ -32,7 +32,6 @@
32 32  
33 33  * Git Cheat Sheets
34 34  ** [[http://cheat.errtheblog.com/s/git/]]
35 -** [[http://ktown.kde.org/%7Ezrusin/git/git-cheat-sheet-medium.png]]
36 36  
37 37  * [[Linus Torvalds talks about git>>http://www.youtube.com/watch?v=4XpnKHJAok8]]
38 38  Have a Good Laugh here as Linus Torvalds Evangelizes git. //NOTE: This isn't really learning, but it is way more fun and gives you insight into the motivation behind git.//
... ... @@ -82,11 +82,13 @@
82 82  * [[SourceTree on AppStore>>http://itunes.apple.com/us/app/sourcetree-git-hg/id411678673?mt=12]]
83 83  * [[SourceTree Home Page>>http://www.sourcetreeapp.com/]]
84 84  
85 -=== GitX git GUI ===
81 +=== GitX (L) git GUI ===
86 86  
87 -GitX is an awesome FREE history viewer made for OS X. It is a better way to visualize your branch and commit history of your git repository. However, power users (aka "cool kids") will probably only use it for history viewing while they continue to use the terminal command line for checkouts, branching, staging, rebasing and committing.
88 -[[GitX Home Page>>http://gitx.frim.nl/]]
83 +While most (if not all) Git GUI apps will never be able to emulate all the intricate functionality of Git, one advantage of a GUI app is more convenient and faster browsing/visualization of history and inter-relationships of branches. While development on the original open source GitX.app has waned, this fork of the original has continued to mature into a nice Git client, and is useful for common every day Git operations. However, power users (aka "cool kids") will probably only use it for history viewing while they continue to use the terminal command line for checkouts, branching, staging, rebasing and committing.
84 +[[GitX (L) Home Page>>http://gitx.laullon.com/]]
89 89  
86 +Note this app replaces the original [[GitX>>http://gitx.frim.nl/]] by Pieter de Bie.
87 +
90 90  === Open in GitX ===
91 91  
92 92  [[Open In GitX Finder Droplet>>http://code.google.com/p/git-osx-installer/wiki/OpenInGitX]]
... ... @@ -98,6 +98,20 @@
98 98  I use Tower (bought it), but only for committing and fixing merge conflicts. I think Tower misses quite a bit of the flagship feature of GIT: branches. You can't see a branch tree graphically, like you can with gitX or even the command line (git log -graph -color, IIRC). But it's cool for committing. For everything else I use command line.
99 99   Miguel Arroz
100 100  
99 +=== Gitolite - A Git Repository Server ===
100 +
101 +Need a way to host a few dozen or hundred repositories with dead simple administration? Look no further than the free and open-source [[gitolite>>http://sitaramc.github.com/gitolite/]]. You just need a single dedicated user account on some unix based OS. Once installed and configured, you can perform administration tasks such as adding users, adding repositories and setting fine-grained user access privileges all from your own desktop.
102 +
103 +The best place to start is probably the ProGit chapter on gitolite, which is maintained by the author of gitolite, and is right here:
104 +[[Pro Got Gitolite Chapter>>https://github.com/sitaramc/gitolite/blob/pu/doc/progit-article.mkd]]
105 +
106 +Some tips/gotchas to keep in mind when setting up gitolite
107 +
108 +* Make sure you give the gitolite user ownership of the admin public ssh key after copying the key over
109 +* Rename your public keyname to username.pub, where username is the name you want to use to identify yourself when configuring gitolite access control to repositories.
110 +* During setup, gitolite creates the file /.ssh/authorized//keys in the gitolite user account. Ensure it has permissions of 600. If not change it//
111 +* If other system users such as apache, chiliproject or redmine need [[read access to the gitolite repositories to allow integration>>http://www.giocc.com/public-repositories-in-gitolite-with-umasks.html]], then you probably want to change the $REPO//MASK configuration value from 0077 to 0027 in the [[gitolite configuration file>>http://sitaramc.github.com/gitolite/rc.html]]//
112 +
101 101  = Unique Git Concepts =
102 102  
103 103  === Rebasing ===
... ... @@ -159,3 +159,19 @@
159 159  git reset --hard
160 160  
161 161  {{/code}}
174 +
175 +=== Stash to Clean and Checkout from Stash to Work ===
176 +
177 +Say that you have several different things going on in your project at any one time. How can you seperate them to check something in? You know about the "git stash" command, which cleans up your project. But what if you want part of the dirtiness, but not all of it?
178 +
179 +Suppose you have file1.java, file2.java, file3.java, and file4.java. You have a single feature implemented in file1.java and file3.java and those edits stand on their own. If you are going to check in just file1.java and file3.java, you should test them on their own, without your other changes. First, do a "git stash". A "git status" will show you have no staged changes. Now do:
180 +
181 +{{code}}
182 +
183 +git checkout stash@{0} -- file1.java
184 +git checkout stash@{0} -- file3.java
185 +
186 +{{/code}}
187 +
188 +Now you have your two files and not the others and you can build and test them in a clear project before you check them in!
189 +One odd thing I noticed is this. The "git diff" you were doing before the stash will show your changes. Now you have to do "git diff HEAD". Not completely sure why, but there it is.