Changes for page Getting Started with Git
Last modified by Bastian Triller on 2013/05/21 17:24
From version 168.1
edited by Kieran Kelleher
on 2011/04/01 15:01
on 2011/04/01 15:01
Change comment:
There is no comment for this version
To version 194.1
edited by Kieran Kelleher
on 2011/04/29 12:14
on 2011/04/29 12:14
Change comment:
There is no comment for this version
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,1 @@ 1 -git 1 +Getting Started with Git - Content
-
... ... @@ -1,3 +1,8 @@ 1 += Got Git? If not, Get Git here = 2 + 3 +Just pick the latest release for your Mac architecture here: 4 +[[OS X dmg Installer>>http://code.google.com/p/git-osx-installer/]] 5 + 1 1 = Learning About git = 2 2 3 3 Start here: ... ... @@ -5,6 +5,7 @@ 5 5 * [[Excellent Concept Tutorial on Git>>http://www.eecs.harvard.edu/~~cduan/technical/git/]] 6 6 7 7 Have a Good Laugh here as Linus Torvalds Evangelizes git: 13 +//this is more fun than learning, but gives you insight into the motivation behind git// 8 8 9 9 * [[Linus Torvalds talks about git>>http://www.youtube.com/watch?v=4XpnKHJAok8]] 10 10 ... ... @@ -18,10 +18,15 @@ 18 18 * [[Git User Manual>>http://www.kernel.org/pub/software/scm/git/docs/user-manual.html]] 19 19 * [[Git Reference>>http://gitref.org/index.html]] 20 20 21 - = InstallGit=27 +Git Cheat Sheets 22 22 23 -[[OS X dmg Installer>>http://code.google.com/p/git-osx-installer/]] 29 +* [[http://cheat.errtheblog.com/s/git/]] 30 +* [[http://ktown.kde.org/%7Ezrusin/git/git-cheat-sheet-medium.png]] 24 24 32 +Checkout (Clone) Wonder Source Code, Build and Install 33 + 34 +* [[Instructions>>http://wiki.objectstyle.org/confluence/display/WONDER/Downloading%2C+Building%2C+Installing+and+Upgrading+Wonder+Source+Code]] 35 + 25 25 = Git Goodies = 26 26 27 27 === Git Bash Completion === ... ... @@ -43,89 +43,32 @@ 43 43 For those of you who just get panic attacks at the thought of using the Terminal, there is a commercial app for that: 44 44 [[Git Tower>>http://www.git-tower.com/]] 45 45 46 -= Using git locally on a Subversion Working Copy = 57 +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. 58 + Miguel Arroz 47 47 48 - OK,so you are addictedtogit,and now you have to work on a team project thatis hosted in aremote subversionrepository ... and it is making you depressed :-(.Well, you can use manage yourlocal svn workingcopyusing git and be happy again!60 +== Using git locally on a Subversion Working Copy == 49 49 50 - Thereisa git-svn tool(typeman git-svn in the terminal for details),but that adds yetanothertoolintothe mix thatyou have tolearn. Sowhile youcoulduseitndYMMV forprojectsthtare goingtobeonsvnforever, I recommend you justusethe [[git+svnprotocol>>http://www.lostechies.com/blogs/derickbailey/archive/2010/02/03/branch-per-feature-how-i-manage-subversion-with-git-branches.aspx]] instead,especiallyifyou aretypicallyworking ononeparticularbranchof theremote svn repository.62 +OK, so you are addicted to git, and now you have to work on a team project that is hosted in a remote subversion repository ... and it is making you depressed :-( . Well, you can use manage your local svn working copy using git and be happy again 51 51 52 - =IwanttolearngitbeforeI switchSubversion=64 +I recommend you just use the [[git+svn protocol>>http://www.lostechies.com/blogs/derickbailey/archive/2010/02/03/branch-per-feature-how-i-manage-subversion-with-git-branches.aspx]]. 53 53 54 -(This kind of repeats some of the previous section, but that's on purpose so we can condition you brain to start using git right now ;-) ) 55 -Even while you are working with svn repositories, you can start learning and taking advantage of git right now by making your local svn working copy an actual local git repository. The idea is to use the appropriate ignore feature of each SCM system to ignore the hidden files of the other system. The concept is described here: 66 +== Git Concepts == 56 56 57 - [[**git+svn**Working Protocol>>http://www.lostechies.com/blogs/derickbailey/archive/2010/02/03/branch-per-feature-how-i-manage-subversion-with-git-branches.aspx]]68 +=== Rebasing === 58 58 59 - When you first learn about gitand yougoogle"gitsvn"youwill learnabout a command line toolgit-svnwhich works directly withremotesvn repos. Unless you want to use git locally toswitchbetweensvn branches, I don'trecommend it. Usethe **git+svn** approach outlinedinaboveblog postinstead.70 +Rebasing is unique to git. There is no counterpart in Subversion. 60 60 61 - Onceyou start usinggit,itbecomesaddictive.......youcan nevergoback...... really,it'shat good......and it isnot hard.72 +Rebasing cuts down on the spaghetti history of merging and helps to keep history nice and linear. 62 62 63 - Some tipsforEclipsesetupandgeneralworkflowwhenusinggitlocallyonsvnworkingcopies,74 +Conceptually, when I rebase my current branch A on another branch B, git removes all my branch A commits back to the common ancestor of A and B, stashes those commits away temporarily, moves the head of the current branch A to the tip of the other branch B, and then re-applys all my stashed commits as **new commit** patches to my branch B. 64 64 65 -* check out the entire svn branch that you work on using the command line, then LINK (import no copy) the projects you want in your workspace using the Subclipse import tool, and 66 -* Do your git operations (status, staging, commit, diff, branching, checkouts, rebase and merge using the terminal). git on the terminal is efficient... honest. 67 -* Do all your local work and cimmits on branches other than the master branch. 68 -* Switch to master branch to update from svn and commit those svn updates on the master branch. 69 -* Merge your working branch(es) with or rebase your working branch(es) from the master and just keep on working. 70 -* Switch to master branch before synchronizing with remote svn repo. 71 -* You can use ##git stash## to temporarily put aside your uncommitted changes before doing an svn update. Then use ##git stash pop## to replay those uncommitted changes onto the working copy. 76 +However before using it on work that is shared with others you MUST follow the these rules, otherwise you will screw everyone else on the project. 72 72 73 -{{code title="Mechanics of an svn update operation on a git-managed svn working copy"}} 78 +* If you don't understand rebasing, don't use it! 79 +* Use rebase on **private** branches 80 +* Use rebase for commits that have **not been pushed** to a remote repo 74 74 75 - 76 -# Assume you are currently on a working branch. Verify this and check for uncommitted changes. 77 -git status 78 - 79 -# Either commit your local changes to your working branch 80 -# using 'git add' + 'git commit', or temporarily stash 81 -# them using 'git stash' 82 -git stash 83 - 84 -# Switch to master branch 85 -git checkout master 86 - 87 -# Ensure there are no changes either from an svn perspective 88 -# or a git perspective on the master branch. 89 -git status 90 -svn status 91 - 92 -# Update the master branch from remote svn repo 93 -svn update 94 - 95 -# Commit those updates to git repo 96 -git commit -a -m "updated from remote svn repo" 97 - 98 -# Switch to your working branch 99 -git checkout workingbranch 100 - 101 -# Merge or rebase your working branch off of the updated master. 102 -# This rewinds your branch commits back to the common commit ancestor 103 -# shared between your working branch and the master branch. Then it 104 -# applies the master branch commits (the svn updates) so that this 105 -# working branch becomes identical to the master. After that it 'replays' 106 -# your working branch commits on top of the updated branch. 107 -# This ensures a clean linear progression. Rebasing is a very cool feature of git. 108 -rebase master 109 - 110 -# Now if you stashed uncommitted changes earlier, you can pop them back into 111 -# the working copy 112 -git stash pop 113 - 114 -{{/code}} 115 - 116 -{{code title="Mechanics of an svn commit operation from a git-managed svn working copy"}} 117 - 118 -# First perform an svn update as outlined above in the previous section 119 - 120 -# Switch to the master branch 121 -git checkout master 122 - 123 -# Merge your working branch with the master 124 -git merge workingbranch 125 - 126 -# Use svn status, svn add and svn commit to commit your changes to the remote svn repository 127 - 128 -# Switch back to your workingbranch and get back to work. 129 - 130 - 131 -{{/code}} 82 +[[http://progit.org/book/ch3-6.html]] 83 +[[http://www.eecs.harvard.edu/~~cduan/technical/git/git-5.shtml]] 84 +[[http://book.git-scm.com/4_rebasing.html]] 85 +[[http://blip.tv/file/4094727]]