You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: book/01-introduction/1-introduction.asc
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,8 @@
2
2
== Getting Started
3
3
4
4
This chapter will be about getting started with Git.
5
-
We will begin at the beginning by explaining some background on version control tools, then move on to how to get Git running on your system and finally how to get it setup to start working with.
6
-
At the end of this chapter you should understand why Git is around, why you should use it and you should be all setup to do so.
5
+
We will begin by explaining some background on version control tools, then move on to how to get Git running on your system and finally how to get it set up to start working with.
6
+
At the end of this chapter you should understand why Git is around, why you should use it and you should be all set up to do so.
Copy file name to clipboardExpand all lines: book/07-git-tools/sections/rewriting-history.asc
+8-1Lines changed: 8 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -109,7 +109,7 @@ When you save and exit the editor, Git rewinds you back to the last commit in th
109
109
[source,console]
110
110
----
111
111
$ git rebase -i HEAD~3
112
-
Stopped at 7482e0d... updated the gemspec to hopefully work better
112
+
Stopped at f7f3f6d... changed my name a bit
113
113
You can amend the commit now, with
114
114
115
115
git commit --amend
@@ -174,12 +174,19 @@ The script puts helpful instructions in the rebase message:
174
174
#
175
175
# Commands:
176
176
# p, pick = use commit
177
+
# r, reword = use commit, but edit the commit message
177
178
# e, edit = use commit, but stop for amending
178
179
# s, squash = use commit, but meld into previous commit
180
+
# f, fixup = like "squash", but discard this commit's log message
181
+
# x, exec = run command (the rest of the line) using shell
182
+
#
183
+
# These lines can be re-ordered; they are executed from top to bottom.
179
184
#
180
185
# If you remove a line here THAT COMMIT WILL BE LOST.
186
+
#
181
187
# However, if you remove everything, the rebase will be aborted.
182
188
#
189
+
# Note that empty commits are commented out
183
190
----
184
191
185
192
If, instead of ``pick'' or ``edit'', you specify ``squash'', Git applies both that change and the change directly before it and makes you merge the commit messages together.
@@ -179,34 +179,6 @@ Saved working directory and index state WIP on master: 1b65b17 added the index f
179
179
----
180
180
181
181
182
-
==== Un-applying a Stash
183
-
184
-
In some use case scenarios you might want to apply stashed changes, do some work, but then un-apply those changes that originally came from the stash.
185
-
Git does not provide such a `stash unapply` command, but it is possible to achieve the effect by simply retrieving the patch associated with a stash and applying it in reverse:
186
-
187
-
[source,console]
188
-
----
189
-
$ git stash show -p stash@{0} | git apply -R
190
-
----
191
-
192
-
Again, if you don’t specify a stash, Git assumes the most recent stash:
193
-
194
-
[source,console]
195
-
----
196
-
$ git stash show -p | git apply -R
197
-
----
198
-
199
-
You may want to create an alias and effectively add a `stash-unapply` command to your git.
If you stash some work, leave it there for a while, and continue on the branch from which you stashed the work, you may have a problem reapplying the work.
0 commit comments