Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a force push option in GitHub Desktop?

Using version 1.0.4, I can't find any force push option. Is command line the only way to use force?

Can't push and Can't pull

like image 703
JeffBship Avatar asked Oct 21 '17 17:10

JeffBship


People also ask

How do I force a git desktop push?

The --force option must be used to push an amended commit. The above example assumes it is being executed on an existing repository with a commit history. git commit --amend is used to update the previous commit. The amended commit is then force pushed using the --force option.

How do I force push to GitHub?

To force a push to only one branch, use a + in front of the refspec to push (e.g git push origin +master to force a push to the master branch). See the <refspec>... section above for details. Force an update only if the tip of the remote-tracking ref has been integrated locally.

Can I push from GitHub desktop?

Keeping your local repository in syncGitHub Desktop can keep your local copy of a project in sync with the remote version by pushing and pulling commits.

Can you force push in a pull request?

While you can send pull requests from any branch or commit, with a topic branch you can push follow-up commits if you need to update your proposed changes. Be very careful when force pushing commits to a pull request. Force pushing changes the repository history and can corrupt your pull request.


1 Answers

After spending some time found force push in Github Desktop Mac, (not sure about Windows)

STEP-1: Switch to history, tab.

enter image description here

STEP-2: Then click and drag one commit over the other. Squash commit popup will come, choose accordingly.

https://user-images.githubusercontent.com/19490960/160462212-b9b2fd47-67d7-4796-8ea5-6dbe482536b0.png

STEP-3: Now you will be able to see force push

enter image description here

Hope this helps, Happy Coding!

like image 128
Parthasarathy S Avatar answered Sep 25 '22 18:09

Parthasarathy S