Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions git-guides/git-push.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ As best practice, it's important to run the `git pull` command before you push a

### Common usages and options for `git push`

* `git push -f`: Force a push that would otherwise be blocked, usually because it will delete or overwrite existing commits _(Use with caution!)_
* `git push -f`: Force a push that would otherwise be blocked, usually because it will delete or overwrite existing commits _(WARINING: Use with caution!)_
* `git push -u origin [branch]`: Useful when pushing a new branch, this creates an upstream tracking branch with a lasting relationship to your local branch
* `git push --all`: Push all branches
* `git push --all`: Push all branches _(WARNING: Use With caution, can push undesirable changes)_
* `git push --tags`: Publish tags that aren't yet in the remote repository

You can see all of the options with `git push` in [git-scm's documentation](https://git-scm.com/docs/git-push).
Expand All @@ -46,6 +46,7 @@ Check what branch you are currently on with `git status`. If you are working on
2. Merge the commits from the branch that you _did_ accidentally commit to: `git merge [main]`
3. Push your changes to the remote: `git push`
4. Fix the other branch by checking out to that branch, finding what commit it _should_ be pointed to, and using `git reset --hard` to correct the branch pointer
5. Check if your branch already is created on the upstream, if not `git push --set-upstream origin [branchname]`

## Related Terms

Expand Down