diff --git a/git-guides/git-push.md b/git-guides/git-push.md index c5d4a4743..3e63bac3e 100644 --- a/git-guides/git-push.md +++ b/git-guides/git-push.md @@ -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). @@ -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