-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8a03499
commit 2d2fe04
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 |
---|---|---|
@@ -1,13 +1,24 @@ | ||
#!/bin/bash | ||
|
||
# fetch so we can merge in without first | ||
# having to checkout & pull the branches | ||
git fetch origin | ||
git fetch upstream | ||
|
||
# delete existing branch | ||
git branch -D update-from-upstream | ||
|
||
# we create a new branch from the origin's main (=HEAD, because we fetched) | ||
git branch update-from-upstream origin/main | ||
|
||
# check out the branch | ||
git checkout update-from-upstream | ||
|
||
# merge in the changes from upstream | ||
git merge upstream/main | ||
|
||
# set the current branch's upstream to where we need it to be so we can | ||
# push without being prompted | ||
git branch --set-upstream-to=origin/update-from-upstream update-from-upstream | ||
|
||
# git push origin update-from-upstream |