Sign in Join
Wiki copytemporary

GIT Exercises: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11This page has some exercises so you can experience different solutions/outcomes for a given task.
22
33By providing these (partly trivial) examples, the page ensures that you will not miss any of the scenarios while discovering the wonders of GIT.
44
55## Preface
66
77Some of the examples are about how to deal with your work when other people are pushed in between.
88
99For this you need a 2nd clone. See setup.
1010
1111## Setup
1212
1313The following steps should be performed before going to any of the below items.
1414
1515Initial setup and clone
1616
1717[[SVN to GIT Cheatsheet|SVN_to_GIT_Cheatsheet#Setup]]
1818
1919Second clone
2020
2121To simulate what someone else would have done while you where working. This can use the same user, the effect will be the same.
2222
2323You can either "git clone" again, or just make a copy of the entire directory into which you have cloned.
2424
2525You can then in that 2nd clone alter your username
2626
2727`   git config user.name  martin_2`
2828
2929### Each example setup
3030
3131In your first git folders, create a new branch
3232
3333`  git switch -c martins-test-1`\
3434`  git push --set-upstream origin martins-test-1  ## tell the server there is a new branch`
3535
3636In your 2nd git folder
3737
3838`  git remote update`\
3939`  git switch martins-test-1`
4040
4141Thus both your folders are at the same branch, and are up to date with the remote
4242
4343> **Note:** In the example you work on "martins-test-1". But it is setup the same as your trunk branch would be. Therefore the same will apply when you work on trunk
4444
4545## Pushing your commit, if someone else made changes
4646
4747> **Note:** If you followed the configuration your "git pull" should be configured to default to either "--ff-ony" or "--rebase".\
4848> The arguments given in to "pull" in the examples, will override the defaults
4949
5050### Rebase
5151
52-<table>
53-<thead>
54-<tr>
55-<th style="min-width: 60%; padding: 15px"><p><strong>In Folder1</strong></p></th>
56-<th style="min-width: 30%; padding: 15px"><p><strong>In Folder2 (other person)</strong></p></th>
57-</tr>
58-</thead>
59-<tbody>
60-<tr>
61-<td colspan="2" style="padding-left: 50px;"><p>Setup new branches #Each example setup</p></td>
62-</tr>
63-<tr>
64-<td><p>| Edit the file lcl/forms.pp</p>
65-<p><code>   git commit -m 'test changes' lcl/forms.pp</code></p>
66-<p><code>   git log --oneline --graph --all -n 2</code><br />
67-<code>      * 3b007fdc38 (HEAD -&gt; martins-test-1) test changes</code><br />
68-<code>      * c739dd68a7 (origin/master, origin/HEAD) Revert "Test a change in forms"</code></p>
69-<p>Your commit, follows the previous commit</p></td>
70-<td><p>|</p></td>
71-</tr>
72-<tr>
73-<td><p>|</p></td>
74-<td><p>| Edit the file ide/main.pp</p>
75-<p><code>   git commit -m 'test other' ide/main.pp</code><br />
76-<code>   git push</code></p></td>
77-</tr>
78-<tr>
79-<td><p>|</p>
80-<p><code>   git push</code><br />
81-<code>       ! [rejected]              martins-test-1 -&gt; martins-test-1 (fetch first)</code><br />
82-<code>      error: failed to push some refs to '</code><a href="https://gitlab.com/freepascal.org/lazarus_testconversion.git"><code>https://gitlab.com/freepascal.org/lazarus_testconversion.git</code></a><code>'</code></p>
83-<p>Instead of the normal pull, we do a fetch. This will not resolve the problem, but we can see what it looks like.</p>
84-<p><code>   git fetch</code></p>
85-<p><code>   git log --oneline --graph --all -n 3</code><br />
86-<code>      * 46a817b6b3 (origin/martins-test-1) test other</code><br />
87-<code>      | * 3b007fdc38 (HEAD -&gt; martins-test-1) test changes</code><br />
88-<code>      |/</code><br />
89-<code>      | * c739dd68a7 (origin/master, origin/HEAD) Revert "Test a change in forms"</code></p></td>
90-<td><p>|</p></td>
91-</tr>
92-<tr>
93-<td colspan="2" style="padding-left: 50px; font-size:88%;"><p>For the #Merge example stop here, and continue in the next section</p></td>
94-</tr>
95-<tr>
96-<td><p>| You can see your commit still follows the same commit as before.</p>
97-<p>But on the server (origin/martins-test-1) there is the other commit, and it too has the same parent. The history on the server is fixed. We do not allow for it to be changed. So that commit will keep its parent.</p>
98-<p>In order to get your commit to the server, your local commit must change it's parent to "test other" (this is called "rebase")</p>
99-<p><code>   git pull --rebase</code><br />
100-<code>      Successfully rebased and updated refs/heads/martins-test-1.</code></p>
101-<p><code>   git log --oneline --graph --all -n 3</code><br />
102-<code>      * 2cbe840e7e (HEAD -&gt; martins-test-1) test changes</code><br />
103-<code>      * 46a817b6b3 (origin/martins-test-1) test changes</code><br />
104-<code>      * c739dd68a7 (origin/master, origin/HEAD) Revert "Test a change in forms"</code></p>
105-<p>Now your commit is on top, and we have a flat line of commits (like svn)</p>
106-<p><code>    git push</code></p></td>
107-<td><p>|</p></td>
108-</tr>
109-</tbody>
110-</table>
52+****In Folder1****
11153
54+****In Folder2 (other person)****
55+
56+Setup new branches #Each example setup
57+
58+\| Edit the file lcl/forms.pp
59+
60+`   git commit -m 'test changes' lcl/forms.pp`
61+
62+`   git log --oneline --graph --all -n 2`\
63+`      * 3b007fdc38 (HEAD -> martins-test-1) test changes`\
64+`      * c739dd68a7 (origin/master, origin/HEAD) Revert "Test a change in forms"`
65+
66+Your commit, follows the previous commit
67+
68+\|
69+
70+\|
71+
72+\| Edit the file ide/main.pp
73+
74+`   git commit -m 'test other' ide/main.pp`\
75+`   git push`
76+
77+\|
78+
79+`   git push`\
80+`       ! [rejected]              martins-test-1 -> martins-test-1 (fetch first)`\
81+`      error: failed to push some refs to '`[`https://gitlab.com/freepascal.org/lazarus_testconversion.git`](https://gitlab.com/freepascal.org/lazarus_testconversion.git)`'`
82+
83+Instead of the normal pull, we do a fetch. This will not resolve the problem, but we can see what it looks like.
84+
85+`   git fetch`
86+
87+`   git log --oneline --graph --all -n 3`\
88+`      * 46a817b6b3 (origin/martins-test-1) test other`\
89+`      | * 3b007fdc38 (HEAD -> martins-test-1) test changes`\
90+`      |/`\
91+`      | * c739dd68a7 (origin/master, origin/HEAD) Revert "Test a change in forms"`
92+
93+\|
94+
95+For the #Merge example stop here, and continue in the next section
96+
97+\| You can see your commit still follows the same commit as before.
98+
99+But on the server (origin/martins-test-1) there is the other commit, and it too has the same parent. The history on the server is fixed. We do not allow for it to be changed. So that commit will keep its parent.
100+
101+In order to get your commit to the server, your local commit must change it's parent to "test other" (this is called "rebase")
102+
103+`   git pull --rebase`\
104+`      Successfully rebased and updated refs/heads/martins-test-1.`
105+
106+`   git log --oneline --graph --all -n 3`\
107+`      * 2cbe840e7e (HEAD -> martins-test-1) test changes`\
108+`      * 46a817b6b3 (origin/martins-test-1) test changes`\
109+`      * c739dd68a7 (origin/master, origin/HEAD) Revert "Test a change in forms"`
110+
111+Now your commit is on top, and we have a flat line of commits (like svn)
112+
113+`    git push`
114+
115+\|
116+
112117### Merge
113118
114119> **Warning:** This example is what we want to avoid. This creates a diverged history (sub-branches). The log is no longer linear.
115120
116-<table>
117-<thead>
118-<tr>
119-<th style="min-width: 60%; padding: 15px"><p><strong>In Folder1</strong></p></th>
120-<th style="min-width: 30%; padding: 15px"><p><strong>In Folder2 (other person)</strong></p></th>
121-</tr>
122-</thead>
123-<tbody>
124-<tr>
125-<td colspan="2" style="padding-left: 50px;"><p>Setup new branches #Each example setup</p>
126-<p>Repeat the steps from #Rebase above until you have done "git fetch" and reached the note for the "merge example"</p></td>
127-</tr>
128-<tr>
129-<td><p>|</p>
130-<p>Now run</p>
131-<p><code>   git pull --no-ff --no-rebase</code><br />
132-<code>      Merge made by the 'recursive' strategy.</code><br />
133-<code>       ide/main.pp | 3 ---</code><br />
134-<code>       1 file changed, 3 deletions(-)</code></p>
135-<p>The --no-ff --no-rebase overrides any configs you may have made, and gets you the default behaviour of merging. Git will open an editor for you, and ask for a commit message for the merge. The merge creates a new commit.</p>
136-<p><code>   git log --oneline --graph --all -n 4</code><br />
137-<code>      *   044d9288b7 (HEAD -&gt; martins-test-2) Merge branch 'martins-test-2' of </code><a href="https://gitlab.com/freepascal.org/lazarus_testconversion"><code>https://gitlab.com/freepascal.org/lazarus_testconversion</code></a><code> into martins-test-2</code><br />
138-<code>      |\</code><br />
139-<code>      | * 379b633c88 (origin/martins-test-2) test other</code><br />
140-<code>      * | cfa3def67c test changes</code><br />
141-<code>      |/</code><br />
142-<code>      * 2cbe840e7e foo bar</code></p>
143-<p>As you can see the two commits are in different sub-branches (they are actually side by side). And a new merge commit has been added.</p>
144-<p>You can push this.</p>
145-<p>But this creates a commit log, like you would never see in svn.</p></td>
146-<td><p>|</p></td>
147-</tr>
148-</tbody>
149-</table>
121+****In Folder1****
150122
123+****In Folder2 (other person)****
124+
125+Setup new branches #Each example setup
126+
127+Repeat the steps from #Rebase above until you have done "git fetch" and reached the note for the "merge example"
128+
129+\|
130+
131+Now run
132+
133+`   git pull --no-ff --no-rebase`\
134+`      Merge made by the 'recursive' strategy.`\
135+`       ide/main.pp | 3 ---`\
136+`       1 file changed, 3 deletions(-)`
137+
138+The --no-ff --no-rebase overrides any configs you may have made, and gets you the default behaviour of merging. Git will open an editor for you, and ask for a commit message for the merge. The merge creates a new commit.
139+
140+`   git log --oneline --graph --all -n 4`\
141+`      *   044d9288b7 (HEAD -> martins-test-2) Merge branch 'martins-test-2' of `[`https://gitlab.com/freepascal.org/lazarus_testconversion`](https://gitlab.com/freepascal.org/lazarus_testconversion)` into martins-test-2`\
142+`      |\`\
143+`      | * 379b633c88 (origin/martins-test-2) test other`\
144+`      * | cfa3def67c test changes`\
145+`      |/`\
146+`      * 2cbe840e7e foo bar`
147+
148+As you can see the two commits are in different sub-branches (they are actually side by side). And a new merge commit has been added.
149+
150+You can push this.
151+
152+But this creates a commit log, like you would never see in svn.
153+
154+\|
155+
151156### Fast Forward
152157
153158> **Note:** In this example you will not have made a commit. Only the other person will have made a commit
154159
155160Fast-Forward (FF) can only happen if
156161
157162- there are new commits from a someone else
158163- but you have not made a commit yourself
159164
160-<table>
161-<thead>
162-<tr>
163-<th style="min-width: 60%; padding: 15px"><p><strong>In Folder1</strong></p></th>
164-<th style="min-width: 30%; padding: 15px"><p><strong>In Folder2 (other person)</strong></p></th>
165-</tr>
166-</thead>
167-<tbody>
168-<tr>
169-<td colspan="2" style="padding-left: 50px;"><p>Setup new branches #Each example setup</p></td>
170-</tr>
171-<tr>
172-<td><p>| Edit the file lcl/forms.pp Do <strong>not</strong> commit the changes.</p>
173-<p><code>   git status -uno</code><br />
174-<code>      On branch martins-test-1</code><br />
175-<code>      Your branch is up to date with 'origin/martins-test-1'.</code><br />
176-<code>      </code><br />
177-<code>      Changes not staged for commit:</code><br />
178-<code>        (use "git add &lt;file&gt;..." to update what will be committed)</code><br />
179-<code>        (use "git restore &lt;file&gt;..." to discard changes in working directory)</code><br />
180-<code>              modified:   lcl/forms.pp</code></p>
181-<p>Your changes are relative to the last commit</p>
182-<p><code>   git log --oneline -n1</code><br />
183-<code>      c739dd68a7 (HEAD -&gt; martins-test-1) Foo bar"</code></p></td>
184-<td><p>|</p></td>
185-</tr>
186-<tr>
187-<td><p>|</p></td>
188-<td><p>| Edit the file ide/main.pp</p>
189-<p><code>   git commit -m 'test other' ide/main.pp</code><br />
190-<code>   git push</code></p></td>
191-</tr>
192-<tr>
193-<td><p>| Fetch the data from the remote</p>
194-<p><code>   git fetch</code></p>
195-<p>Status will tell you you are behind the remote</p>
196-<p><code>   git status -uno</code><br />
197-<code>      On branch martins-test-1</code><br />
198-<code>      Your branch is behind 'origin/martins-test-1' by 1 commit, and can be fast-forwarded.</code><br />
199-<code>        (use "git pull" to update your local branch)</code><br />
200-<code>      </code><br />
201-<code>      Changes not staged for commit:</code><br />
202-<code>        (use "git add &lt;file&gt;..." to update what will be committed)</code><br />
203-<code>        (use "git restore &lt;file&gt;..." to discard changes in working directory)</code><br />
204-<code>              modified:   lcl/forms.pp</code></p>
205-<p>Your changes are still relative to the last local commit. Indicated by "HEAD"</p>
206-<p><code>   git log --oneline -n2 origin/martins-test-1</code><br />
207-<code>      bc20668e78 (origin/martins-test-1) test other</code><br />
208-<code>      c739dd68a7 (HEAD -&gt; martins-test-1) Foo bar"</code></p>
209-<p><code>   git pull --ff-only</code><br />
210-<code>      Updating c739dd68a7..bc20668e78</code><br />
211-<code>      Fast-forward</code><br />
212-<code>       ide/main.pp | 2 ++</code><br />
213-<code>       1 file changed, 2 insertions(+)</code></p>
214-<p>Now the local branch "martins-test-1" has caught up to the remote branch. It includes the new commits. And it switched to the top commit.<br />
215-This catching up, is a fast forward.</p>
216-<ul>
217-<li>No local branches commits where changed/moved/added. Only the branch pointer moved</li>
218-<li>Your changes are still there, and are now relative to the top commit</li>
219-</ul>
220-<p><code>   git log --oneline -n2 --graph origin/martins-test-1</code><br />
221-<code>      bc20668e78 (HEAD -&gt; martins-test-1, origin/martins-test-1) test other</code><br />
222-<code>      c739dd68a7 Foo bar"</code></p></td>
223-<td><p>|</p></td>
224-</tr>
225-</tbody>
226-</table>
165+****In Folder1****
227166
167+****In Folder2 (other person)****
168+
169+Setup new branches #Each example setup
170+
171+\| Edit the file lcl/forms.pp Do **not** commit the changes.
172+
173+`   git status -uno`\
174+`      On branch martins-test-1`\
175+`      Your branch is up to date with 'origin/martins-test-1'.`\
176+`      `\
177+`      Changes not staged for commit:`\
178+`        (use "git add <file>..." to update what will be committed)`\
179+`        (use "git restore <file>..." to discard changes in working directory)`\
180+`              modified:   lcl/forms.pp`
181+
182+Your changes are relative to the last commit
183+
184+`   git log --oneline -n1`\
185+`      c739dd68a7 (HEAD -> martins-test-1) Foo bar"`
186+
187+\|
188+
189+\|
190+
191+\| Edit the file ide/main.pp
192+
193+`   git commit -m 'test other' ide/main.pp`\
194+`   git push`
195+
196+\| Fetch the data from the remote
197+
198+`   git fetch`
199+
200+Status will tell you you are behind the remote
201+
202+`   git status -uno`\
203+`      On branch martins-test-1`\
204+`      Your branch is behind 'origin/martins-test-1' by 1 commit, and can be fast-forwarded.`\
205+`        (use "git pull" to update your local branch)`\
206+`      `\
207+`      Changes not staged for commit:`\
208+`        (use "git add <file>..." to update what will be committed)`\
209+`        (use "git restore <file>..." to discard changes in working directory)`\
210+`              modified:   lcl/forms.pp`
211+
212+Your changes are still relative to the last local commit. Indicated by "HEAD"
213+
214+`   git log --oneline -n2 origin/martins-test-1`\
215+`      bc20668e78 (origin/martins-test-1) test other`\
216+`      c739dd68a7 (HEAD -> martins-test-1) Foo bar"`
217+
218+`   git pull --ff-only`\
219+`      Updating c739dd68a7..bc20668e78`\
220+`      Fast-forward`\
221+`       ide/main.pp | 2 ++`\
222+`       1 file changed, 2 insertions(+)`
223+
224+Now the local branch "martins-test-1" has caught up to the remote branch. It includes the new commits. And it switched to the top commit.\
225+This catching up, is a fast forward.
226+
227+- No local branches commits where changed/moved/added. Only the branch pointer moved
228+- Your changes are still there, and are now relative to the top commit
229+
230+`   git log --oneline -n2 --graph origin/martins-test-1`\
231+`      bc20668e78 (HEAD -> martins-test-1, origin/martins-test-1) test other`\
232+`      c739dd68a7 Foo bar"`
233+
234+\|
235+
228236## Conflict Resolution
229237
230238### Getting selected upstream changes
231239
232-<table>
233-<thead>
234-<tr>
235-<th style="min-width: 60%; padding: 15px"><p><strong>In Folder1</strong></p></th>
236-<th style="min-width: 30%; padding: 15px"><p><strong>In Folder2 (other person)</strong></p></th>
237-</tr>
238-</thead>
239-<tbody>
240-<tr>
241-<td colspan="2" style="padding-left: 50px;"><p>Setup new branches #Each example setup</p></td>
242-</tr>
243-<tr>
244-<td><p>| Edit the file lcl/forms.pp<br />
245-Edit the file ide/main.pp somewhere from line 100 down</p>
246-<p><code>   git diff --stat</code><br />
247-<code>      ide/main.pp  | 5 +++++</code><br />
248-<code>      lcl/forms.pp | 4 ++++</code><br />
249-<code>      2 files changed, 9 insertions(+)</code></p>
250-<p><code>   git log --oneline -n 1</code><br />
251-<code>      c739dd68a7 (HEAD -&gt; martins-test-1) Foo Bar"</code></p></td>
252-<td><p>|</p></td>
253-</tr>
254-<tr>
255-<td><p>|</p></td>
256-<td><p>| Edit the file ide/main.pp somewere in the first 20 lines (no conflict with the main user in folder1)<br />
257-Also edit the file lcl/grids.pas</p>
258-<p><code>   git commit -m 'test other' -a</code><br />
259-<code>   git push</code></p></td>
260-</tr>
261-<tr>
262-<td><p>| Update from remote. Keep current commit as base for your changes</p>
263-<p><code>   git fetch</code><br />
264-<code>   git log --oneline -n2  origin/martins-test-1</code><br />
265-<code>      810b4f1bd4 (origin/martins-test-1) test other</code><br />
266-<code>      c739dd68a7 (HEAD -&gt; martins-test-1) Foo Bar</code></p>
267-<p>The commit "test other" changes several files. For testing you want to integrate the changes in file ide/main.pp, but no other changes.</p>
268-<p><code>   git stash</code><br />
269-<code>   git restore --source=origin/martins-test-1  ide/main.pp</code><br />
270-<code>   git commit -m 'dummy commit'  ide/main.pp</code><br />
271-<code>   git stash pop</code></p>
272-<p>Now you have a dummy commit with the changes to test. And your changes applied on top.</p>
273-<p><code>   git log --oneline -n2</code><br />
274-<code>      63e2dcec9f (HEAD -&gt; martins-test-1) dummy commit</code><br />
275-<code>      c739dd68a7 Foo Bar</code><br />
276-<code>   git diff --stat</code><br />
277-<code>      ide/main.pp  | 5 +++++</code><br />
278-<code>      lcl/forms.pp | 4 ++++</code><br />
279-<code>      2 files changed, 9 insertions(+)</code></p>
280-<p>Now work with those changes, make further changes, eventually commit</p>
281-<p><code>   git commit -m 'my changes' -a</code><br />
282-<code>      [martins-test-1 9aba7218d1] my changes</code><br />
283-<code>       2 files changed, 9 insertions(+)</code></p>
284-<p><code>   git log --oneline -n5 --graph --all</code><br />
285-<code>      * 9aba7218d1 (HEAD -&gt; martins-test-1) my changes</code><br />
286-<code>      * 63e2dcec9f dummy commit</code><br />
287-<code>      | * 810b4f1bd4 (origin/martins-test-1) test other</code><br />
288-<code>      |/</code><br />
289-<code>      * c739dd68a7 Foo Bar</code></p>
290-<p>So you now need to rebase your changes on the origin/martins-test-1 to commit them.</p>
291-<p><code>   git pull --rebase</code><br />
292-<code>      Successfully rebased and updated refs/heads/martins-test-1.</code></p>
293-<p><code>   git log --oneline -n3</code><br />
294-<code>      f0d6afd90d (HEAD -&gt; martins-test-1) my changes</code><br />
295-<code>      810b4f1bd4 (origin/martins-test-1) test other</code><br />
296-<code>      c739dd68a7 Foo Bar</code></p>
297-<p>The "dummy commit" is gone. Because it was identical to existing changes. Of course you should check this. If it is still there you need to drop it with</p>
298-<p><code>   git rebase -i </code></p></td>
299-<td><p>|</p></td>
300-</tr>
301-</tbody>
302-</table>
240+****In Folder1****
241+
242+****In Folder2 (other person)****
243+
244+Setup new branches #Each example setup
245+
246+\| Edit the file lcl/forms.pp\
247+Edit the file ide/main.pp somewhere from line 100 down
248+
249+`   git diff --stat`\
250+`      ide/main.pp  | 5 +++++`\
251+`      lcl/forms.pp | 4 ++++`\
252+`      2 files changed, 9 insertions(+)`
253+
254+`   git log --oneline -n 1`\
255+`      c739dd68a7 (HEAD -> martins-test-1) Foo Bar"`
256+
257+\|
258+
259+\|
260+
261+\| Edit the file ide/main.pp somewere in the first 20 lines (no conflict with the main user in folder1)\
262+Also edit the file lcl/grids.pas
263+
264+`   git commit -m 'test other' -a`\
265+`   git push`
266+
267+\| Update from remote. Keep current commit as base for your changes
268+
269+`   git fetch`\
270+`   git log --oneline -n2  origin/martins-test-1`\
271+`      810b4f1bd4 (origin/martins-test-1) test other`\
272+`      c739dd68a7 (HEAD -> martins-test-1) Foo Bar`
273+
274+The commit "test other" changes several files. For testing you want to integrate the changes in file ide/main.pp, but no other changes.
275+
276+`   git stash`\
277+`   git restore --source=origin/martins-test-1  ide/main.pp`\
278+`   git commit -m 'dummy commit'  ide/main.pp`\
279+`   git stash pop`
280+
281+Now you have a dummy commit with the changes to test. And your changes applied on top.
282+
283+`   git log --oneline -n2`\
284+`      63e2dcec9f (HEAD -> martins-test-1) dummy commit`\
285+`      c739dd68a7 Foo Bar`\
286+`   git diff --stat`\
287+`      ide/main.pp  | 5 +++++`\
288+`      lcl/forms.pp | 4 ++++`\
289+`      2 files changed, 9 insertions(+)`
290+
291+Now work with those changes, make further changes, eventually commit
292+
293+`   git commit -m 'my changes' -a`\
294+`      [martins-test-1 9aba7218d1] my changes`\
295+`       2 files changed, 9 insertions(+)`
296+
297+`   git log --oneline -n5 --graph --all`\
298+`      * 9aba7218d1 (HEAD -> martins-test-1) my changes`\
299+`      * 63e2dcec9f dummy commit`\
300+`      | * 810b4f1bd4 (origin/martins-test-1) test other`\
301+`      |/`\
302+`      * c739dd68a7 Foo Bar`
303+
304+So you now need to rebase your changes on the origin/martins-test-1 to commit them.
305+
306+`   git pull --rebase`\
307+`      Successfully rebased and updated refs/heads/martins-test-1.`
308+
309+`   git log --oneline -n3`\
310+`      f0d6afd90d (HEAD -> martins-test-1) my changes`\
311+`      810b4f1bd4 (origin/martins-test-1) test other`\
312+`      c739dd68a7 Foo Bar`
313+
314+The "dummy commit" is gone. Because it was identical to existing changes. Of course you should check this. If it is still there you need to drop it with
315+
316+`   git rebase -i `
317+
318+\|
303319
304320---
305321*From the Free Pascal wiki, page "GIT Exercises", as it stood on 2021-12-29 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
306322Category: Version Control

Back to history