Skip to content

Instantly share code, notes, and snippets.

@nmpegetis
Created December 20, 2018 20:04
Show Gist options
  • Save nmpegetis/206c8bc48aa2cfba41063f15f93efcb3 to your computer and use it in GitHub Desktop.
Save nmpegetis/206c8bc48aa2cfba41063f15f93efcb3 to your computer and use it in GitHub Desktop.
# Case 1: You checked out a new branch from your local repository, with git checkout -b <new branch>
git push --set-upstream <remote branch, usually 'origin'> <local new branch> # this is also proposed from git itself if you git push

# Case 2: You checked out an existing repository and rebase went fine
git push

# Case 3: You checked out an existing repository and rebase had conflicts that you solved
git push --force-with-lease
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment