kishikaisei
kishikaisei

Reputation: 97

Pushing in Gitkraken, does it use force with lease?

I use force push with lease quite often when rebasing in my work, I wanted to know if gitkraken, under the hood, when clicking on force push, does it run a force push, or force push with lease.

Upvotes: 3

Views: 716

Answers (2)

Roxy Walsh
Roxy Walsh

Reputation: 679

According to GitKracken's User Suggestions page, as of August 2023 --force-with-lease is now the default behaviour

Force push with lease is now available with the release of GitKraken Client 9.6.1!

Force push will now default to --force-with-lease with the Git Executable feature enabled. You will now be prompted to fetch or push --force (without lease) when the remote ref and remote-tracking branch are different.

https://feedback.gitkraken.com/suggestions/193783/add-force-option-forcewithlease

I realise this is a fairly old question, but I came across it looking for the answer myself so thought it worth mentioning once I found the answer!

Upvotes: 0

Alvin Sartor
Alvin Sartor

Reputation: 2449

It runs a bare and simple force push.

I am a big fan of rebasing, squashing and amending my own commits, all operations that require to force push. To clarify any doubt, I did a test to see if the force push was running with the lease option and it does not.

If you want to check it yourself:

  1. Clone your repository on two different folders: folder_A and folder_B
  2. Create a branch from one of the two repos, push it to origin, and make sure both repositories check it out.
  3. Go to folder_B, modify any file, commit and push.
  4. Go to folder_A, do not fetch modify any file, amend your latest commit and push.

You will see that the repository in folder_A will have overwritten any changes made from folder_B.

If you try to pull from folder_B you will see it is on a broken state as the commit it was referencing to has been destroyed.

EDIT: shortly after having tested this myself I sent an email to GitKraken, asking if the feature of pushing with lease was going to be enabled anytime soon. They said that they have multiple requests for it. Surely it will be interesting to check the situation in some time to see how it is proceeding.

Upvotes: 2

Related Questions