Created
February 28, 2022 09:03
-
-
Save KenanBek/570b8033716cfeb0e8e8e6d67f939e90 to your computer and use it in GitHub Desktop.
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
## | |
# Sync with upstream | |
### | |
# add upstream | |
git remote add upstream <git_remote_url> | |
# fetch changes | |
git fetch upstream | |
# rebase current main (or master) with upstream | |
git rebase upstream/main | |
# push changes to fork's remote | |
git push origin main --force | |
## | |
# Fork as a private repo | |
### | |
# bare clone | |
git clone --bare <git_remote_url> | |
# push as a mirror | |
cd <git_remote_repo_name> | |
git push --mirror <git_private_fork_url> | |
# now you can remove that folder | |
cd .. | |
rm -rf <git_remote_repo_name> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment