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
This commit is contained in:
parent
9359bcaeee
commit
20209c0497
|
@ -45,23 +45,13 @@ Branches
|
||||||
Use **git rebase** instead of **git merge** and **git pull**, when you're updating your feature-branch.
|
Use **git rebase** instead of **git merge** and **git pull**, when you're updating your feature-branch.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# switch to master branch
|
|
||||||
|
|
||||||
# fetch updates all remote branch references in the repo and all submodules
|
# fetch updates all remote branch references in the repo and all submodules
|
||||||
# --all : tells it to do it for all remotes (handy, when you use your fork)
|
# --all : tells it to do it for all remotes (handy, when you use your fork)
|
||||||
# -p : tells it to remove obsolete remote branch references (when they are removed from remote)
|
# -p : tells it to remove obsolete remote branch references (when they are removed from remote)
|
||||||
git fetch --all -p
|
git fetch --all -p
|
||||||
|
|
||||||
# pull updates your local files
|
# rebase on origin/master will rewrite your branch history
|
||||||
# you should call this command ONLY from master branch
|
git rebase origin/master
|
||||||
git pull origin master
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
Then switch to your branch and do a rebase
|
|
||||||
|
|
||||||
```
|
|
||||||
git rebase master
|
|
||||||
```
|
```
|
||||||
|
|
||||||
#### More complex scenarios
|
#### More complex scenarios
|
||||||
|
|
Loading…
Reference in a new issue