submit
overwrite a coworker's changes to my branch?git push --force-with-lease
under the hood for our push, which should ensure this doesn't happen. You should only be able to overwrite changes that you have already pushed from your machine or synced to your machine with downstack get
.--force
(i.e., push to a branch on remote even if remote's SHA cannot be fast-forwarded to the new SHA), with the caveat that if the remote's SHA for the branch doesn't match the "remote-tracking branch" on your machine (e.g. refs/remotes/origin/feature
), it will fail, as this means that someone else has updated the branch since you last pushed to it or pulled it. Graphite respects the "remote-tracking branch", only updating it on a submit
or downstack get
operation.git fetch
ing your branches in the background, which could update the "remote-tracking branch" and result in the --force-with-lease
check passing even if someone has updated the branch to a commit that you haven't synced to your repo (or pushed yourself).gt commit create
, and if you end up with multiple commits on a branch by accident, you can always use gt branch squash
to get your branch back to a single commit. This way, you can essentially only use gt
, and your workflow will look something like:
(making use of lots of shortcuts and short-form flags)