-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update all submodules to latest commit on origin
- Loading branch information
1 parent
78cf3d2
commit bff6c64
Showing
1 changed file
with
11 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Update all submodules to latest commit on origin | ||
|
||
I use [Git submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules) in a bunch of projects, and one common task is checking out the latest commit on the origin. | ||
|
||
Since Git 1.8.2 this is a one-liner, but I'm always forgetting it, so here it is: | ||
|
||
```sh | ||
git submodule update --remote --rebase # or `--merge` if you swing that way | ||
``` | ||
|
||
The answers to [this StackOverflow question](https://stackoverflow.com/q/5828324) have some more detail (including a command that works on earlier versions of Git). |