Changes for page Getting Started with Git

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

From version 68.1
edited by Kieran Kelleher
on 2012/01/03 10:02
Change comment: There is no comment for this version
To version 76.1
edited by Bastian Triller
on 2013/05/21 17:24
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.kieran
1 +XWiki.btriller
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  
... ... @@ -19,8 +19,9 @@
19 19  ** Scott Chacon (of GitHub) Video Intro [[http://www.youtube.com/watch?v=ZDR433b0HJY]]
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
19 +** [[Git For Ages 4 And Up>>https://lca2013.linux.org.au/wiki/Tutorials/Git_For_Ages_4_And_Up]]: video tutorial ([[mp4>>http://mirror.internode.on.net/pub/linux.conf.au/2013/mp4/Git_For_Ages_4_And_Up.mp4]], [[YouTube>>http://www.youtube.com/watch?v=1ffBJ4sVUb4]])
22 22  * Learn the basics.
23 -** [[Everyday GIT With 20 Commands Or So>>http://www.kernel.org/pub/software/scm/git/docs/everyday.html]]
21 +** [[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.//
... ... @@ -100,6 +100,28 @@
100 100  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.
101 101   Miguel Arroz
102 102  
100 +=== Gitolite - A Git Repository Server ===
101 +
102 +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.
103 +
104 +The best place to start is probably the ProGit chapter on gitolite, which is maintained by the author of gitolite, and is right here:
105 +[[Pro Got Gitolite Chapter>>https://github.com/sitaramc/gitolite/blob/pu/doc/progit-article.mkd]]
106 +
107 +Some tips/gotchas to keep in mind when setting up gitolite
108 +
109 +* Make sure you give the gitolite user ownership of the admin public ssh key after copying the key over
110 +* 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.
111 +* During setup, gitolite creates the file /.ssh/authorized//keys in the gitolite user account. Ensure it has permissions of 600. If not change it//
112 +* 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]]//
113 +
114 +=== Gitlab - Self hosted Git management software ===
115 +
116 +From the [[Gitlab>>http://gitlab.org/]] homepage:
117 +
118 +GitLab is a fast, secure and stable solution to manage your projects.
119 +It is based on Ruby on Rails and has a free and open-source license (MIT).
120 +GitLab is the most installed git management application in the world.
121 +
103 103  = Unique Git Concepts =
104 104  
105 105  === Rebasing ===
... ... @@ -130,10 +130,10 @@
130 130  
131 131  === Testing a Pull-Request ===
132 132  
133 -It may not be obvious how to do this. If one is a committer, there is a button one can push to automatically accept a pull-request. But is this really a safe thing to do? But how can you get the diffs being suggested? It seems more complicated than it needs to be to merge the branch the pull-request was made from. One can actually use a URL that specifies just the diff. If the pull-request is at [[https://github.com/projectwonder/wonder/pull/43]], one can do:
152 +It may not be obvious how to do this. If one is a committer, there is a button one can push to automatically accept a pull-request. But is this really a safe thing to do? But how can you get the diffs being suggested? It seems more complicated than it needs to be to merge the branch the pull-request was made from. One can actually use a URL that specifies just the diff. If the pull-request is at [[https://github.com/wocommunity/wonder/pull/43]], one can do:
134 134  
135 135  {{code}}
136 -curl 'https://github.com/projectwonder/wonder/pull/43.patch' | git am
155 +curl 'https://github.com/wocommunity/wonder/pull/43.patch' | git am
137 137  {{/code}}
138 138  
139 139  The curl fetches the diff. Take off the "git am" to just see the diffs. The "git am" merges the diffs. Then you may build and test the pull-request. A normal push will push the code into the repository.
... ... @@ -161,3 +161,19 @@
161 161  git reset --hard
162 162  
163 163  {{/code}}
183 +
184 +=== Stash to Clean and Checkout from Stash to Work ===
185 +
186 +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?
187 +
188 +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:
189 +
190 +{{code}}
191 +
192 +git checkout stash@{0} -- file1.java
193 +git checkout stash@{0} -- file3.java
194 +
195 +{{/code}}
196 +
197 +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
198 +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.