From: | Sebastian Pipping <sping@g.o> | ||
---|---|---|---|
To: | gentoo-portage-dev@l.g.o | ||
Subject: | Re: [gentoo-portage-dev] portage sources have moved from SVN to GIT | ||
Date: | Thu, 25 Mar 2010 00:55:50 | ||
Message-Id: | 4BAAB465.9030306@gentoo.org | ||
In Reply to: | [gentoo-portage-dev] portage sources have moved from SVN to GIT by Zac Medico |
1 | On 03/24/10 09:07, Zac Medico wrote: |
2 | > If you have push access then you can commit something to the master |
3 | > branch like this: |
4 | > |
5 | > git clone git+ssh://git@×××××××××××××××××××.org/proj/portage.git |
6 | > cd portage |
7 | > # edit files |
8 | > git commit -a |
9 | > git push origin master |
10 | |
11 | Let me add a few more words and pointers: let me get you started. |
12 | |
13 | |
14 | In this mail |
15 | ============ |
16 | - First thing to do |
17 | |
18 | - On "origin" |
19 | - Not like Subversion: Commits in Git |
20 | - Committing versus pushing |
21 | - Non-linear history |
22 | - Commits and the staging area |
23 | - You in the future |
24 | |
25 | - Resources (lots of recommendable ones) |
26 | |
27 | - Questions? |
28 | |
29 | |
30 | First thing to do |
31 | ================= |
32 | After cloning you need to set up your commit identity: |
33 | |
34 | git config --global user.name 'Dr. First Middle Last' |
35 | git config --global user.email 'nick@g.o' |
36 | |
37 | Missing that up front is more work later. |
38 | |
39 | |
40 | On "origin" |
41 | =========== |
42 | The "origin" Zac mentioned is the name of a remote - a URI Git can pull |
43 | from and (sometimes even) push to. Soon you will work with more than |
44 | one remote: From personal experience I recommend to rename that remote |
45 | to something more meaningful, something reflecting the involved host at |
46 | best, e.g. |
47 | |
48 | git remote rename origin overlays-gentoo-org |
49 | ^old ^new |
50 | |
51 | |
52 | Not like Subversion: Commits in Git |
53 | ==================================== |
54 | |
55 | Committing versus pushing |
56 | ------------------------- |
57 | In Git you commit locally, even without network connectivity. |
58 | You do a few local commits and push them to the server in an extra step: |
59 | |
60 | git commit |
61 | git commit |
62 | .. |
63 | git push overlays-gentoo-org master |
64 | |
65 | In the beginning this separation may feel like a burden. |
66 | You'll soon appreciate to have it. |
67 | |
68 | |
69 | Commits and the staging area |
70 | ---------------------------- |
71 | When you do |
72 | |
73 | git commit |
74 | |
75 | the content of the staging area (called "index" sometimes) is written |
76 | into a new commit object. |
77 | |
78 | So modifying the staging area you change what goes into the next commit. |
79 | Commands like |
80 | |
81 | git add file3.txt |
82 | git add -u |
83 | git add -p |
84 | git reset |
85 | |
86 | do changes in the index for you. |
87 | |
88 | The index is one of the core features and differences to other systems |
89 | including Subversion. Understanding the index is essential to working |
90 | with Git. Please study online material on that topic. |
91 | |
92 | |
93 | Non-linear history |
94 | ------------------ |
95 | Due to its distributed nature |
96 | - history is a directed acyclic graph (DAG) in Git, not a list |
97 | - revision IDs are SHA1s, not plain numbers |
98 | |
99 | I can recommend emerging dev-vcs/gitg for a visual history browser. |
100 | Present is on top, moving down is moving into the past |
101 | |
102 | |
103 | You in the future |
104 | ================= |
105 | Now that we're on Git you'll soon be able (and expected) to |
106 | |
107 | re-order |
108 | merge |
109 | split |
110 | clean-up |
111 | |
112 | past commits, i.e. re-write history. The related commands are |
113 | |
114 | git commit --amend |
115 | |
116 | and |
117 | |
118 | git rebase -i |
119 | |
120 | See here if you want to know more: |
121 | http://book.git-scm.com/4_interactive_rebasing.html |
122 | |
123 | |
124 | Resources (lots of recommendable ones) |
125 | ======================================= |
126 | |
127 | Video Talks on Git |
128 | ------------------ |
129 | - (2007-05-03) Linus Torvalds |
130 | "Source code control the way it was meant to be!" |
131 | http://www.youtube.com/watch?v=4XpnKHJAok8 |
132 | |
133 | - (2007-10-12) Randal Schwartz |
134 | "Git" |
135 | http://www.youtube.com/watch?v=8dhZ9BXQgc4 |
136 | |
137 | - (2008-06-01) Scott Chacon |
138 | "Getting Git" |
139 | http://www.markrichman.com/2008/06/14/railsconf-git-talk/ |
140 | http://www.vimeo.com/1099027?pg=embed&sec=1099027 |
141 | |
142 | - (2008-07-09) Tommi Virtanen |
143 | "Version Control for Developers" |
144 | http://blip.tv/file/1114793/ |
145 | |
146 | - (2008-07-09) Bart Trojanowski |
147 | "Git the basics" |
148 | http://excess.org/article/2008/07/ogre-git-tutorial/ |
149 | |
150 | - (2008-10-27) Johannes Schindelin |
151 | "Contributing with Git" |
152 | http://www.youtube.com/watch?v=j45cs5_nY2k |
153 | |
154 | |
155 | Online Reading |
156 | -------------- |
157 | |
158 | Introductions |
159 | ````````````` |
160 | - Git Magic |
161 | http://www-cs-students.stanford.edu/~blynn/gitmagic/ |
162 | |
163 | - The Git Community Book |
164 | http://book.git-scm.com/ |
165 | |
166 | - Git from the bottom up |
167 | http://ftp.newartisans.com/pub/git.from.bottom.up.pdf |
168 | |
169 | - The Git Parable |
170 | http://tom.preston-werner.com/2009/05/19/the-git-parable.html |
171 | |
172 | - Pro Git |
173 | http://progit.org/book/ |
174 | |
175 | |
176 | Task-oriented material |
177 | `````````````````````` |
178 | - Git Ready |
179 | http://gitready.com/ |
180 | |
181 | - Git Casts (actually short films) |
182 | http://gitcasts.com/ |
183 | |
184 | - Git FAQ |
185 | https://git.wiki.kernel.org/index.php/GitFaq |
186 | |
187 | |
188 | Questions? |
189 | ========== |
190 | - Check #git on Freenode <-- very helpful |
191 | - Mail me |
192 | - Call me: +49 177 / 460 46 17 |
193 | |
194 | |
195 | Thanks for reading! |
196 | |
197 | |
198 | |
199 | Sebastian Pipping |