Skip to content

Instantly share code, notes, and snippets.

@KenanBek
Created February 28, 2022 09:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KenanBek/570b8033716cfeb0e8e8e6d67f939e90 to your computer and use it in GitHub Desktop.
Save KenanBek/570b8033716cfeb0e8e8e6d67f939e90 to your computer and use it in GitHub Desktop.
##
# 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