Skip to content

Commit 20209c0

Browse files
authored
Simplify update sync local repo workflow in powershell-repository-101.md
The best way to sync a branch for our purposes is to rebase on origin/master
1 parent 9359bca commit 20209c0

1 file changed

Lines changed: 2 additions & 12 deletions

File tree

docs/git/powershell-repository-101.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,23 +45,13 @@ Branches
4545
Use **git rebase** instead of **git merge** and **git pull**, when you're updating your feature-branch.
4646

4747
```sh
48-
# switch to master branch
49-
5048
# fetch updates all remote branch references in the repo and all submodules
5149
# --all : tells it to do it for all remotes (handy, when you use your fork)
5250
# -p : tells it to remove obsolete remote branch references (when they are removed from remote)
5351
git fetch --all -p
5452

55-
# pull updates your local files
56-
# you should call this command ONLY from master branch
57-
git pull origin master
58-
59-
```
60-
61-
Then switch to your branch and do a rebase
62-
63-
```
64-
git rebase master
53+
# rebase on origin/master will rewrite your branch history
54+
git rebase origin/master
6555
```
6656

6757
#### More complex scenarios

0 commit comments

Comments
 (0)