author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Mon, 22 Feb 2016 12:46:36 +0200 | |
changeset 1905 | fba288d59662 |
parent 1815 | 49fb4309d4d0 |
child 1912 | 8b81a8f0f692 |
permissions | -rw-r--r-- |
1002 | 1 |
.. -*- coding: utf-8; -*- |
1334
9bf0d5a1f0cf
Include common header with quick links.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1089
diff
changeset
|
2 |
.. include:: HEADER.rst |
1002 | 3 |
|
4 |
====== |
|
5 |
Git. |
|
6 |
====== |
|
1032
4decc3e00bb6
Fix coding and contents.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1002
diff
changeset
|
7 |
.. contents:: |
1905
fba288d59662
Include only local subsections into TOC. This prevent duplication of
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1815
diff
changeset
|
8 |
:local: |
1002 | 9 |
|
10 |
Setup git. |
|
11 |
========== |
|
12 |
||
13 |
Debian. |
|
14 |
------- |
|
15 |
||
16 |
For Etch Degian release use git-core package from backports, |
|
17 |
old 1.4 version of git very dumb compared to new version 1.5:: |
|
18 |
||
19 |
$ sudo apt-get install git-core |
|
20 |
||
21 |
After install setup some options:: |
|
22 |
||
23 |
$ git config --global user.name "Oleksandr Gavenko" |
|
24 |
$ git config --global user.mail "gavenkoa@gmail.com" |
|
25 |
$ cat ~/.gitconfig |
|
26 |
[user] |
|
27 |
name = Oleksandr Gavenko |
|
28 |
mail = gavenkoa@gmail.com |
|
29 |
||
30 |
Cygwin. |
|
31 |
------- |
|
32 |
||
33 |
$ setup.exe -p git |
|
34 |
||
35 |
git over proxy. |
|
36 |
=============== |
|
37 |
||
38 |
Only http:// protocol support proxy (not git://):: |
|
39 |
||
40 |
$ export http_proxy="http://username:password@proxy:port/" |
|
41 |
$ git clone http://github.com/$user/$proj.git $proj |
|
42 |
||
43 |
You can store proxy settings under repository local config file:: |
|
44 |
||
45 |
$ git config http.proxy http://$user:$passwd@$ip:$port |
|
46 |
||
47 |
Start your project. |
|
48 |
=================== |
|
49 |
||
50 |
Setup proj space on fs:: |
|
51 |
||
52 |
$ mkdir proj |
|
53 |
$ cd proj |
|
54 |
$ git init |
|
55 |
Initialized empty Git repository in /home/user/tmp/proj/.git/ |
|
56 |
$ ls -a |
|
57 |
. .. .git |
|
58 |
||
59 |
Add file, make changes, commit all:: |
|
60 |
||
61 |
$ emacs Makefile |
|
62 |
... C-x C-c |
|
63 |
$ emacs app.c |
|
64 |
... C-x C-c |
|
65 |
$ git add Makefile app.c |
|
66 |
$ git status |
|
67 |
# On branch master |
|
68 |
# |
|
69 |
# Initial commit |
|
70 |
# |
|
71 |
# Changes to be committed: |
|
72 |
# (use "git rm --cached <file>..." to unstage) |
|
73 |
# |
|
74 |
# new file: Makefile |
|
75 |
# new file: app.c |
|
76 |
# |
|
77 |
||
78 |
or just:: |
|
79 |
||
80 |
$ git add . |
|
81 |
||
82 |
Commit newlly added file:: |
|
83 |
||
84 |
$ git commit |
|
85 |
... Write message log ... |
|
86 |
Created initial commit 2169263: My first commit massage. |
|
87 |
1 files changed, 4 insertions(+), 0 deletions(-) |
|
88 |
create mode 100644 app.c |
|
89 |
||
90 |
Undo tracking added file. |
|
91 |
========================= |
|
92 |
||
93 |
You do:: |
|
94 |
||
95 |
$ git add badfile |
|
96 |
$ git status |
|
97 |
# On branch master |
|
98 |
# Changes to be committed: |
|
99 |
# (use "git reset HEAD <file>..." to unstage) |
|
100 |
# |
|
101 |
# new file: badfile |
|
102 |
# |
|
103 |
||
104 |
To stop tracking badfile do:: |
|
105 |
||
106 |
$ git rm --cached badfile |
|
107 |
$ git status |
|
108 |
# On branch master |
|
109 |
# Untracked files: |
|
110 |
# (use "git add <file>..." to include in what will be committed) |
|
111 |
# |
|
112 |
# file |
|
113 |
nothing added to commit but untracked files present (use "git add" to track) |
|
114 |
||
115 |
or:: |
|
116 |
||
117 |
$ git reset badfile |
|
118 |
||
119 |
Doing changes. |
|
120 |
============== |
|
121 |
:: |
|
122 |
||
123 |
$ printf "clean:\n<TAB>rm $(wildcard *.o)\n" >>Makefile |
|
124 |
$ git diff |
|
125 |
diff --git a/Makefile b/Makefile |
|
126 |
index e84f7e9..cd2438a 100644 |
|
127 |
--- a/Makefile |
|
128 |
+++ b/Makefile |
|
129 |
@@ -1,2 +1,5 @@ |
|
130 |
all: |
|
131 |
@echo XXX |
|
132 |
exit 1 |
|
133 |
+ |
|
134 |
+clean: |
|
135 |
+ rm -f *.o |
|
136 |
$ git add Makefile |
|
137 |
$ git commit -m "Added clean target." |
|
138 |
Created commit 11272b9: Added clean target. |
|
139 |
1 files changed, 1 insertions(+), 0 deletions(-) |
|
140 |
create mode 100644 file |
|
141 |
||
142 |
or just:: |
|
143 |
||
144 |
$ git commit -a -m "Added clean target." |
|
145 |
||
146 |
git analog of 'hg incoming'. |
|
147 |
============================ |
|
148 |
||
149 |
git does not directly support such feature. You can emulate it by:: |
|
150 |
||
151 |
$ git fetch |
|
152 |
$ git log master..origin/master # or just '..origin/master' |
|
153 |
||
154 |
By previous commands you grab changes from remote server! You can apply them:: |
|
155 |
||
156 |
TODO |
|
157 |
$ git merge |
|
158 |
||
159 |
git analog of 'hg outgoing'. |
|
160 |
============================ |
|
161 |
||
162 |
git does not directly support such feature. You can emulate it by:: |
|
163 |
||
164 |
$ git fetch |
|
165 |
$ git log origin/master..master # or just 'origin/master..' |
|
166 |
||
1650
a48c3c61d0f9
git analog of 'hg glog'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1641
diff
changeset
|
167 |
git analog of 'hg glog'. |
a48c3c61d0f9
git analog of 'hg glog'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1641
diff
changeset
|
168 |
======================== |
a48c3c61d0f9
git analog of 'hg glog'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1641
diff
changeset
|
169 |
:: |
a48c3c61d0f9
git analog of 'hg glog'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1641
diff
changeset
|
170 |
|
a48c3c61d0f9
git analog of 'hg glog'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1641
diff
changeset
|
171 |
$ git log --all --graph |
a48c3c61d0f9
git analog of 'hg glog'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1641
diff
changeset
|
172 |
|
a48c3c61d0f9
git analog of 'hg glog'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1641
diff
changeset
|
173 |
Add alias:: |
a48c3c61d0f9
git analog of 'hg glog'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1641
diff
changeset
|
174 |
|
a48c3c61d0f9
git analog of 'hg glog'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1641
diff
changeset
|
175 |
[alias] |
a48c3c61d0f9
git analog of 'hg glog'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1641
diff
changeset
|
176 |
glog = log --all --graph |
a48c3c61d0f9
git analog of 'hg glog'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1641
diff
changeset
|
177 |
|
1651
c77807176b36
Git analog of 'hg rollback'
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1650
diff
changeset
|
178 |
Git analog of 'hg rollback'. |
c77807176b36
Git analog of 'hg rollback'
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1650
diff
changeset
|
179 |
============================ |
c77807176b36
Git analog of 'hg rollback'
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1650
diff
changeset
|
180 |
|
c77807176b36
Git analog of 'hg rollback'
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1650
diff
changeset
|
181 |
To edit commit message of last commit:: |
c77807176b36
Git analog of 'hg rollback'
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1650
diff
changeset
|
182 |
|
c77807176b36
Git analog of 'hg rollback'
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1650
diff
changeset
|
183 |
$ git commit --amend -m "$MSG" |
c77807176b36
Git analog of 'hg rollback'
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1650
diff
changeset
|
184 |
|
c77807176b36
Git analog of 'hg rollback'
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1650
diff
changeset
|
185 |
To edit messages of old commits starting from ``$REV``:: |
c77807176b36
Git analog of 'hg rollback'
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1650
diff
changeset
|
186 |
|
c77807176b36
Git analog of 'hg rollback'
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1650
diff
changeset
|
187 |
$ git rebase -i $REV |
c77807176b36
Git analog of 'hg rollback'
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1650
diff
changeset
|
188 |
|
1771
b2d4be61da16
Git analog of 'hg root'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1714
diff
changeset
|
189 |
Git analog of 'hg root'. |
b2d4be61da16
Git analog of 'hg root'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1714
diff
changeset
|
190 |
======================== |
b2d4be61da16
Git analog of 'hg root'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1714
diff
changeset
|
191 |
:: |
b2d4be61da16
Git analog of 'hg root'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1714
diff
changeset
|
192 |
|
b2d4be61da16
Git analog of 'hg root'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1714
diff
changeset
|
193 |
$ git rev-parse --show-toplevel |
b2d4be61da16
Git analog of 'hg root'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1714
diff
changeset
|
194 |
|
1002 | 195 |
Debug git network operation. |
196 |
============================ |
|
197 |
||
198 |
Git uses libcurl for network operation:: |
|
199 |
||
200 |
$ export GIT_CURL_VERBOSE=1 |
|
201 |
$ git ... |
|
202 |
||
1076
9b2eb3c96d84
Push new repo to remote.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1032
diff
changeset
|
203 |
Push new repo to remote. |
9b2eb3c96d84
Push new repo to remote.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1032
diff
changeset
|
204 |
======================== |
9b2eb3c96d84
Push new repo to remote.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1032
diff
changeset
|
205 |
:: |
9b2eb3c96d84
Push new repo to remote.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1032
diff
changeset
|
206 |
|
9b2eb3c96d84
Push new repo to remote.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1032
diff
changeset
|
207 |
$ mkdir $REPO |
9b2eb3c96d84
Push new repo to remote.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1032
diff
changeset
|
208 |
$ cd $REPO |
9b2eb3c96d84
Push new repo to remote.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1032
diff
changeset
|
209 |
$ git init |
9b2eb3c96d84
Push new repo to remote.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1032
diff
changeset
|
210 |
$ git add . |
9b2eb3c96d84
Push new repo to remote.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1032
diff
changeset
|
211 |
$ git commit -m "Initial commit" |
9b2eb3c96d84
Push new repo to remote.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1032
diff
changeset
|
212 |
$ git remote add origin https://$USER:$PASS@$HOST/$REPO |
9b2eb3c96d84
Push new repo to remote.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1032
diff
changeset
|
213 |
$ git push -u origin master |
9b2eb3c96d84
Push new repo to remote.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1032
diff
changeset
|
214 |
|
1641
04e215a475e0
Show heads in branch.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
215 |
Show heads in branch. |
04e215a475e0
Show heads in branch.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
216 |
===================== |
04e215a475e0
Show heads in branch.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
217 |
:: |
04e215a475e0
Show heads in branch.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
218 |
|
04e215a475e0
Show heads in branch.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
219 |
$ git show-ref --heads -s |
04e215a475e0
Show heads in branch.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1334
diff
changeset
|
220 |
|
1089
2c23dfe7517e
Find most recent tag for revision.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1076
diff
changeset
|
221 |
Find most recent tag for revision. |
2c23dfe7517e
Find most recent tag for revision.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1076
diff
changeset
|
222 |
================================== |
2c23dfe7517e
Find most recent tag for revision.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1076
diff
changeset
|
223 |
:: |
2c23dfe7517e
Find most recent tag for revision.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1076
diff
changeset
|
224 |
|
2c23dfe7517e
Find most recent tag for revision.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1076
diff
changeset
|
225 |
$ git describe $REV |
2c23dfe7517e
Find most recent tag for revision.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1076
diff
changeset
|
226 |
|
1815
49fb4309d4d0
Find most recent tag for revision.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1771
diff
changeset
|
227 |
Many projects set tags on branches rather then mainline (for example JS/CSS |
49fb4309d4d0
Find most recent tag for revision.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1771
diff
changeset
|
228 |
projects perform build and commit binary/minified files, which unnecessary for |
49fb4309d4d0
Find most recent tag for revision.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1771
diff
changeset
|
229 |
mainline history). In this case review simplifiied history by:: |
49fb4309d4d0
Find most recent tag for revision.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1771
diff
changeset
|
230 |
|
49fb4309d4d0
Find most recent tag for revision.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1771
diff
changeset
|
231 |
$ git log --graph --all --decorate --oneline --simplify-by-decoration |
49fb4309d4d0
Find most recent tag for revision.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1771
diff
changeset
|
232 |
|
1714
eed8cfffa44e
List tags with dates.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1651
diff
changeset
|
233 |
List tags with dates. |
eed8cfffa44e
List tags with dates.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1651
diff
changeset
|
234 |
===================== |
eed8cfffa44e
List tags with dates.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1651
diff
changeset
|
235 |
:: |
eed8cfffa44e
List tags with dates.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1651
diff
changeset
|
236 |
|
eed8cfffa44e
List tags with dates.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1651
diff
changeset
|
237 |
$ git log --tags --simplify-by-decoration --pretty="format:%ci %d" |
eed8cfffa44e
List tags with dates.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1651
diff
changeset
|
238 |
|
eed8cfffa44e
List tags with dates.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1651
diff
changeset
|
239 |
Update to date. |
eed8cfffa44e
List tags with dates.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1651
diff
changeset
|
240 |
=============== |
eed8cfffa44e
List tags with dates.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1651
diff
changeset
|
241 |
:: |
eed8cfffa44e
List tags with dates.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1651
diff
changeset
|
242 |
|
eed8cfffa44e
List tags with dates.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1651
diff
changeset
|
243 |
$ git checkout 'master@{1979-02-26}' |
eed8cfffa44e
List tags with dates.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1651
diff
changeset
|
244 |
$ git checkout 'master@{1979-02-26 18:30:00}' |
eed8cfffa44e
List tags with dates.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1651
diff
changeset
|
245 |
|
1002 | 246 |
Using git to work with SVN offline. |
247 |
=================================== |
|
248 |
||
249 |
Prepare SVN and git utilities:: |
|
250 |
||
251 |
$ sudo apt-get svn git-core git-svn |
|
252 |
||
253 |
Making SVN repo:: |
|
254 |
||
255 |
$ cd $HOME/tmp |
|
256 |
$ svnadmin create svn-repo |
|
257 |
$ svn co file://$HOME/tmp/svn-repo svn-devel |
|
258 |
$ cd svn-devel |
|
259 |
$ mkdir tags trunk branches |
|
260 |
$ svn add * |
|
261 |
A branches |
|
262 |
A tags |
|
263 |
A trunk |
|
264 |
$ cd trunk/ |
|
265 |
$ printf "all:\n echo XXX\n" >Makefile |
|
266 |
$ printf "int main() {return 0;}" >main.c |
|
267 |
$ svn add * |
|
268 |
$ cd .. |
|
269 |
$ svn st |
|
270 |
A trunk |
|
271 |
A trunk/main.c |
|
272 |
A trunk/Makefile |
|
273 |
A branches |
|
274 |
A tags |
|
275 |
$ svn ci -m init |
|
276 |
Adding branches |
|
277 |
Adding tags |
|
278 |
Adding trunk |
|
279 |
Adding trunk/Makefile |
|
280 |
Adding trunk/main.c |
|
281 |
Transmitting file data .. |
|
282 |
$ svn cp -m v0.0 file://$HOME/tmp/svn/trunk file://$HOME/tmp/svn/tags/v0.0 |
|
283 |
$ svn cp -m v0.1 file://$HOME/tmp/svn/trunk file://$HOME/tmp/svn/branches/v0.1 |
|
284 |
||
285 |
Moving SVN changset to git repo:: |
|
286 |
||
287 |
$ cd $HOME/tmp |
|
288 |
$ git svn init file://$HOME/tmp/svn git-repo |
|
289 |
$ ls -a |
|
290 |
. .. .git |
|
291 |
$ git svn fetch |
|
292 |
A trunk/main.c |
|
293 |
A trunk/Makefile |
|
294 |
W: +empty_dir: branches |
|
295 |
W: +empty_dir: tags |
|
296 |
r1 = 52ccd9882979dd53ec198dbac108783ec660410f (git-svn) |
|
297 |
A tags/v0.0/main.c |
|
298 |
A tags/v0.0/Makefile |
|
299 |
r2 = 8ec8a772bb6f37ace56b3649066dc84e481ed427 (git-svn) |
|
300 |
M trunk/Makefile |
|
301 |
r3 = 2c169ff409ed504dd6a092b1e302beb3fd94871e (git-svn) |
|
302 |
A branches/v0.1/main.c |
|
303 |
A branches/v0.1/Makefile |
|
304 |
r4 = e68d76f4ba6beea4b9059c1884c1f38ce10831a7 (git-svn) |
|
305 |
M trunk/Makefile |
|
306 |
r5 = cdde63974454b13ac53f2eeb201aa76c49fd875c (git-svn) |
|
307 |
Checked out HEAD: |
|
308 |
file:///home/sasha/tmp/svn r5 |
|
309 |
||
310 |
or (in old git version):: |
|
311 |
||
312 |
$ git svn clone file://$HOME/tmp/svn git-repo |
|
313 |
||
314 |
Making changes in svn:: |
|
315 |
||
316 |
$ cd $HOME/tmp/svn-devel/trunk |
|
317 |
$ echo ".PHONY: clean" >>Makefile |
|
318 |
$ svn ci -m "Added clean to phony." |
|
319 |
Sending trunk/Makefile |
|
320 |
Transmitting file data . |
|
321 |
Committed revision 6. |
|
322 |
||
323 |
Making committed in git:: |
|
324 |
||
325 |
$ cd $HOME/tmp/git-repo/trunk |
|
326 |
$ echo ".PHONY: all" >>Makefile |
|
327 |
$ echo "int foo(int x) {return x+x;}" >>main.c |
|
328 |
$ git status |
|
329 |
# On branch master |
|
330 |
# Changed but not updated: |
|
331 |
# (use "git add <file>..." to update what will be committed) |
|
332 |
# |
|
333 |
# modified: Makefile |
|
334 |
# modified: main.c |
|
335 |
# |
|
336 |
no changes added to commit (use "git add" and/or "git commit -a") |
|
337 |
$ git commit -a -m "Bug fixed." |
|
338 |
Created commit 222d399: Bug fixed. |
|
339 |
2 files changed, 2 insertions(+), 0 deletions(-) |
|
340 |
||
341 |
Getting changes from SVN to git:: |
|
342 |
||
343 |
$ git svn rebase |
|
344 |
M trunk/Makefile |
|
345 |
r6 = 8165e9bfb38e9df09a7313d19606ec227629b670 (git-svn) |
|
346 |
First, rewinding head to replay your work on top of it... |
|
347 |
Applying Bug fixed. |
|
348 |
error: patch failed: trunk/Makefile:6 |
|
349 |
error: trunk/Makefile: patch does not apply |
|
350 |
Using index info to reconstruct a base tree... |
|
351 |
Falling back to patching base and 3-way merge... |
|
352 |
Auto-merged trunk/Makefile |
|
353 |
CONFLICT (content): Merge conflict in trunk/Makefile |
|
354 |
Failed to merge in the changes. |
|
355 |
Patch failed at 0001. |
|
356 |
||
357 |
When you have resolved this problem run "git rebase --continue". |
|
358 |
If you would prefer to skip this patch, instead run "git rebase --skip". |
|
359 |
To restore the original branch and stop rebasing run "git rebase --abort". |
|
360 |
||
361 |
rebase refs/remotes/git-svn: command returned error: 1 |
|
362 |
$ git add Makefile |
|
363 |
$ git rebase --continue |
|
364 |
Applying Bug fixed. |
|
365 |
||
366 |
and return all from git to SVN:: |
|
367 |
||
368 |
$ git svn dcommit |
|
369 |
Committing to file:///home/sasha/tmp/svn ... |
|
370 |
M trunk/Makefile |
|
371 |
M trunk/main.c |
|
372 |
Committed r7 |
|
373 |
M trunk/main.c |
|
374 |
M trunk/Makefile |
|
375 |
r7 = 68e782c8d06635f2db4dd69b9ca8599f99da22e2 (git-svn) |
|
376 |
No changes between current HEAD and refs/remotes/git-svn |
|
377 |
Resetting to the latest refs/remotes/git-svn |
|
378 |
||
379 |
See what going to SVN repo:: |
|
380 |
||
381 |
$ cd $HOME/tmp/svn-devel/trunk |
|
382 |
$ svn diff -r BASE:HEAD |
|
383 |
Index: Makefile |
|
384 |
=================================================================== |
|
385 |
--- Makefile (working copy) |
|
386 |
+++ Makefile (revision 7) |
|
387 |
@@ -6,4 +6,4 @@ |
|
388 |
.o: .c |
|
389 |
$(CC) $(CFLAGS) -c -o $@ $< |
|
390 |
||
391 |
-.PHONY: clean |
|
392 |
+.PHONY: all clean |
|
393 |
Index: main.c |
|
394 |
=================================================================== |
|
395 |
--- main.c (working copy) |
|
396 |
+++ main.c (revision 7) |
|
397 |
@@ -2,3 +2,4 @@ |
|
398 |
{ |
|
399 |
return 0; |
|
400 |
} |
|
401 |
+int foo(int x) {return x+x;} |
|
402 |
$ svn up |
|
403 |
U Makefile |
|
404 |
U main.c |
|
405 |
Updated to revision 7. |
|
406 |
||
407 |
gitk. |
|
408 |
===== |
|
409 |
||
410 |
gitk - The git repository browser. See gitk(1). |
|
411 |
||
412 |
Installing:: |
|
413 |
||
414 |
$ sudo apt-get instal gitk |
|
415 |
||
416 |
Using:: |
|
417 |
||
418 |
$ cd /path/to/git-repo |
|
419 |
$ gitk |
|
420 |