-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Prefer --force-with-lease
over --force
#363
Conversation
Yes! |
I love
|
This sounds great, but it's very verbose. Is there an abbreviation? Is there any way to override the |
There is no abbreviation according to the man page |
Nor could I find one in the codebase. |
If it's too verbose, may I recommend: [alias]
pf = push --force-with-lease |
@mike-burns is that's the case, should/could there be a matching PR to the dotfiles once if this is merged? |
@seanpdoyle no complaints from me! |
Using `--force-with-lease` allows one to force push without the risk of unintentionally overwriting someone else's work. The git-push(1) man page states: > Usually, "git push" refuses to update a remote ref that is not an > ancestor of the local ref used to overwrite it. > > This option overrides this restriction if the current value of the > remote ref is the expected value. "git push" fails otherwise. > > --force-with-lease alone, without specifying the details, will protect > all remote refs that are going to be updated by requiring their > current value to be the same as the remote-tracking branch we have for > them. > > --@calleerlandsson > -- thoughtbot/guides#363
Using `--force-with-lease` allows one to force push without the risk of unintentionally overwriting someone else's work. The git-push(1) man page states: > Usually, "git push" refuses to update a remote ref that is not an > ancestor of the local ref used to overwrite it. > > This option overrides this restriction if the current value of the > remote ref is the expected value. "git push" fails otherwise. > > --force-with-lease alone, without specifying the details, will protect > all remote refs that are going to be updated by requiring their > current value to be the same as the remote-tracking branch we have for > them. > > --@calleerlandsson > -- thoughtbot/guides#363
> `--force-with-lease` alone, without specifying the details, will protect all > remote refs that are going to be updated by requiring their current value to > be the same as the remote-tracking branch we have for them. thoughtbot/guides#363
I'll merge this. |
Using `--force-with-lease` allows one to force push without the risk of unintentionally overwriting someone else's work. The git-push(1) man page states: > Usually, "git push" refuses to update a remote ref that is not an > ancestor of the local ref used to overwrite it. > > This option overrides this restriction if the current value of the > remote ref is the expected value. "git push" fails otherwise. > > --force-with-lease alone, without specifying the details, will protect > all remote refs that are going to be updated by requiring their > current value to be the same as the remote-tracking branch we have for > them.
Using `--force-with-lease` allows one to force push without the risk of unintentionally overwriting someone else's work. The git-push(1) man page states: > Usually, "git push" refuses to update a remote ref that is not an > ancestor of the local ref used to overwrite it. > > This option overrides this restriction if the current value of the > remote ref is the expected value. "git push" fails otherwise. > > --force-with-lease alone, without specifying the details, will protect > all remote refs that are going to be updated by requiring their > current value to be the same as the remote-tracking branch we have for > them. > > --@calleerlandsson > -- thoughtbot/guides#363
Using `--force-with-lease` allows one to force push without the risk of unintentionally overwriting someone else's work. The git-push(1) man page states: > Usually, "git push" refuses to update a remote ref that is not an > ancestor of the local ref used to overwrite it. > > This option overrides this restriction if the current value of the > remote ref is the expected value. "git push" fails otherwise. > > --force-with-lease alone, without specifying the details, will protect > all remote refs that are going to be updated by requiring their > current value to be the same as the remote-tracking branch we have for > them. > > --@calleerlandsson > -- thoughtbot/guides#363
Using `--force-with-lease` allows one to force push without the risk of unintentionally overwriting someone else's work. The git-push(1) man page states: > Usually, "git push" refuses to update a remote ref that is not an > ancestor of the local ref used to overwrite it. > > This option overrides this restriction if the current value of the > remote ref is the expected value. "git push" fails otherwise. > > --force-with-lease alone, without specifying the details, will protect > all remote refs that are going to be updated by requiring their > current value to be the same as the remote-tracking branch we have for > them. > > --@calleerlandsson > -- thoughtbot/guides#363
Using `--force-with-lease` allows one to force push without the risk of unintentionally overwriting someone else's work. The git-push(1) man page states: > Usually, "git push" refuses to update a remote ref that is not an > ancestor of the local ref used to overwrite it. > > This option overrides this restriction if the current value of the > remote ref is the expected value. "git push" fails otherwise. > > --force-with-lease alone, without specifying the details, will protect > all remote refs that are going to be updated by requiring their > current value to be the same as the remote-tracking branch we have for > them. > > --@calleerlandsson > -- thoughtbot/guides#363
Using `--force-with-lease` allows one to force push without the risk of unintentionally overwriting someone else's work. The git-push(1) man page states: > Usually, "git push" refuses to update a remote ref that is not an > ancestor of the local ref used to overwrite it. > > This option overrides this restriction if the current value of the > remote ref is the expected value. "git push" fails otherwise. > > --force-with-lease alone, without specifying the details, will protect > all remote refs that are going to be updated by requiring their > current value to be the same as the remote-tracking branch we have for > them. > > --@calleerlandsson > -- thoughtbot/guides#363
Using `--force-with-lease` allows one to force push without the risk of unintentionally overwriting someone else's work. The git-push(1) man page states: > Usually, "git push" refuses to update a remote ref that is not an > ancestor of the local ref used to overwrite it. > > This option overrides this restriction if the current value of the > remote ref is the expected value. "git push" fails otherwise. > > --force-with-lease alone, without specifying the details, will protect > all remote refs that are going to be updated by requiring their > current value to be the same as the remote-tracking branch we have for > them. > > --@calleerlandsson > -- thoughtbot/guides#363
Using `--force-with-lease` allows one to force push without the risk of unintentionally overwriting someone else's work. The git-push(1) man page states: > Usually, "git push" refuses to update a remote ref that is not an > ancestor of the local ref used to overwrite it. > > This option overrides this restriction if the current value of the > remote ref is the expected value. "git push" fails otherwise. > > --force-with-lease alone, without specifying the details, will protect > all remote refs that are going to be updated by requiring their > current value to be the same as the remote-tracking branch we have for > them. > > --@calleerlandsson > -- thoughtbot/guides#363
Using `--force-with-lease` allows one to force push without the risk of unintentionally overwriting someone else's work. The git-push(1) man page states: > Usually, "git push" refuses to update a remote ref that is not an > ancestor of the local ref used to overwrite it. > > This option overrides this restriction if the current value of the > remote ref is the expected value. "git push" fails otherwise. > > --force-with-lease alone, without specifying the details, will protect > all remote refs that are going to be updated by requiring their > current value to be the same as the remote-tracking branch we have for > them. > > --@calleerlandsson > -- thoughtbot/guides#363
Using `--force-with-lease` allows one to force push without the risk of unintentionally overwriting someone else's work. The git-push(1) man page states: > Usually, "git push" refuses to update a remote ref that is not an > ancestor of the local ref used to overwrite it. > > This option overrides this restriction if the current value of the > remote ref is the expected value. "git push" fails otherwise. > > --force-with-lease alone, without specifying the details, will protect > all remote refs that are going to be updated by requiring their > current value to be the same as the remote-tracking branch we have for > them. > > --@calleerlandsson > -- thoughtbot/guides#363
Looks like one of your colleagues has done this for you :) |
Using `--force-with-lease` allows one to force push without the risk of unintentionally overwriting someone else's work. The git-push(1) man page states: Usually, "git push" refuses to update a remote ref that is not an ancestor of the local ref used to overwrite it. This option overrides this restriction if the current value of the remote ref is the expected value. "git push" fails otherwise. Imagine that you have to rebase what you have already published. You will have to bypass the "must fast-forward" rule in order to replace the history you originally published with the rebased history. If somebody else built on top of your original history while you are rebasing, the tip of the branch at the remote may advance with her commit, and blindly pushing with --force will lose her work. This option allows you to say that you expect the history you are updating is what you rebased and want to replace. If the remote ref still points at the commit you specified, you can be sure that no other people did anything to the ref. It is like taking a "lease" on the ref without explicitly locking it, and the remote ref is updated only if the "lease" is still valid. References: - https://developer.atlassian.com/blog/2015/04/force-with-lease/ - thoughtbot/guides#363
Using
--force-with-lease
allows one to force push without the risk ofunintentionally overwriting someone else's work.
The git-push(1) man page states: