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
{{ message }}
Repository navigation
Commit 62e8dfa
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: book/07-git-tools/sections/advanced-merging.asc
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -357,7 +357,7 @@ Let's explore a couple of tools that you now have at your disposal to determine
357
357
Perhaps it's not obvious how exactly you should fix this conflict.
358
358
You need more context.
359
359
360
-
One helpful tool is `git checkout` with the `--conflict` option.
360
+
One helpful tool is `git restore` with the `--conflict` option.
361
361
This will re-checkout the file again and replace the merge conflict markers.
362
362
This can be useful if you want to reset the markers and try to resolve them again.
363
363
@@ -366,7 +366,7 @@ If you pass it `diff3`, Git will use a slightly different version of conflict ma
366
366
367
367
[source,console]
368
368
----
369
-
$ git checkout --conflict=diff3 hello.rb
369
+
$ git restore --conflict=diff3 hello.rb
370
370
----
371
371
372
372
Once we run that, the file will look like this instead:
@@ -395,7 +395,7 @@ If you like this format, you can set it as the default for future merge conflict
395
395
$ git config --global merge.conflictstyle diff3
396
396
----
397
397
398
-
The `git checkout` command can also take `--ours` and `--theirs` options, which can be a really fast way of just choosing either one side or the other without merging things at all.
398
+
The `git restore` command can also take `--ours` and `--theirs` options, which can be a really fast way of just choosing either one side or the other without merging things at all.
399
399
400
400
This can be particularly useful for conflicts of binary files where you can simply choose one side, or where you only want to merge certain files in from another branch -- you can do the merge and then checkout certain files from one side or the other before committing.
Copy file name to clipboardExpand all lines: book/07-git-tools/sections/interactive-staging.asc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -200,5 +200,5 @@ At this point, you can exit the interactive adding script and run `git commit` t
200
200
201
201
You also don't need to be in interactive add mode to do the partial-file staging -- you can start the same script by using `git add -p` or `git add --patch` on the command line.
202
202
203
-
Furthermore, you can use patch mode for partially resetting files with the `git reset --patch` command, for checking out parts of files with the `git checkout --patch` command and for stashing parts of files with the `git stash save --patch` command.
203
+
Furthermore, you can use patch mode for partially resetting files with the `git reset --patch` command, for checking out parts of files with the `git restore --patch` command and for stashing parts of files with the `git stash save --patch` command.
204
204
We'll go into more details on each of these as we get to more advanced usages of these commands.
Copy file name to clipboardExpand all lines: book/07-git-tools/sections/submodules.asc
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -293,7 +293,7 @@ Your branch is up-to-date with 'origin/master'.
293
293
294
294
Changes not staged for commit:
295
295
(use "git add <file>..." to update what will be committed)
296
-
(use "git checkout -- <file>..." to discard changes in working directory)
296
+
(use "git restore <file>..." to discard changes in working directory)
297
297
298
298
modified: .gitmodules
299
299
modified: DbConnector (new commits)
@@ -313,7 +313,7 @@ Your branch is up-to-date with 'origin/master'.
313
313
314
314
Changes not staged for commit:
315
315
(use "git add <file>..." to update what will be committed)
316
-
(use "git checkout -- <file>..." to discard changes in working directory)
316
+
(use "git restore <file>..." to discard changes in working directory)
317
317
318
318
modified: .gitmodules
319
319
modified: DbConnector (new commits)
@@ -400,7 +400,7 @@ $ git status
400
400
Your branch is up-to-date with 'origin/master'.
401
401
Changes not staged for commit:
402
402
(use "git add <file>..." to update what will be committed)
403
-
(use "git checkout -- <file>..." to discard changes in working directory)
403
+
(use "git restore <file>..." to discard changes in working directory)
404
404
405
405
modified: DbConnector (new commits)
406
406
@@ -1032,7 +1032,7 @@ Switched to branch 'master'
1032
1032
----
1033
1033
1034
1034
Then, when you switch back, you get an empty `CryptoLibrary` directory for some reason and `git submodule update` may not fix it either.
1035
-
You may need to go into your submodule directory and run a `git checkout .` to get all your files back.
1035
+
You may need to go into your submodule directory and run a `git restore .` to get all your files back.
1036
1036
You could run this in a `submodule foreach` script to run it for multiple submodules.
1037
1037
1038
1038
It's important to note that submodules these days keep all their Git data in the top project's `.git` directory, so unlike much older versions of Git, destroying a submodule directory won't lose any commits or branches that you had.
0 commit comments