Skip to content

Update git cheatsheet #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ To undo or discard commits, you can use
`git commit -a --amend` to amend to previous commit (only if you haven't pushed yet). (Note: if you use `-a` it will include all staged changes, so you might want to `git status` first).

## git push force
`git push --force` will overwrite the status of the branch on the remote with your local status.
* `git push --force` will overwrite the status of the branch on the remote with your local status.

* `git push --force-with-lease` is like `git push --force` with the additional check that the current status of the remote matches the local status for the remote. It helps in preventing you from deleting commits from other team members.

**Note:** The original status on the remote will be **destroyed**. If anyone on the team has that branch locally, they'll need to delete it locally and checkout the branch again to get it in the same status as the remote.

Expand Down