Last active
September 14, 2022 13:34
-
-
Save itroyano/6f8341bbc9ac1961383f45e5cb09935f to your computer and use it in GitHub Desktop.
git commands for new repo
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
In UI create a fork. | |
git clone <fork url> | |
git remote add upstream <url of the original repo I forked from> # Define what is the upstream | |
git config --global pull.rebase true # Set the local repository to rebase on pull | |
git branch --set-upstream-to upstream/main # Set local main to track upstream | |
git checkout <local branch> | |
git pull upstream main # Sync local branch with the upstream main. this will also rebase per the setting above | |
git commit -m <original commit msg> -s --amend # From 2nd commit onwards makes sure there's only one commit | |
git push --force |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment