AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Force push sourcetree3/30/2023 If you disagree, please share your workflow in comments. Select 'Reset current branch to this commit.' In the resulting dialog, select 'Mixed.' from the drop down and click OK. Right click on the last 'good' commit (this will probably be origin/master ). Its not your answers (never used sourcetree), but from the command line its preferable to use hg push -new-branch instead of hg push -force. I conclude that on a rare occasion when a force push is needed, opening Terminal won't hurt. at 13:29 Add a comment 1 Answer Sorted by: 43 To remove the commit without changing any source code, you need to perform a 'mixed' reset. In my case, it will also create a new branch in my remote. In SourceTree version 2.5.5.0 there is an option for that. I've never done a force push since -new-branch was introduced, and never needed it to combine unrelated repositories or push a two-headed branch (a force pull is much safer). The last step, as far as our local repo is concerned, is to push the code to our remote repository. I agree with that this option is more dangerous than useful. I wasn't able to find a way to do a hg push -force proper via the SourceTree dialogs. You can, optionally, specify a branch you want to push if you have outgoing changesets on several branches. Step2: Situation A: target commit is the latest one. 1.4.2) issues a hg push -new-branch as needed, so if you create a new branch (as opposed to having two heads on one branch), you just do a regular push ( Repository â Push). Step1: In the sourcetree main window, locate your repo tab, and click the ' terminal ' button to open the git command console. The first is to right-click (or context-click) on a commit and choose Rebase children of interactively.Tools -> Options -> Git -> Enable Force PushĪfter that, you can force push it using push button in toolbar: There are two ways to start an interactive rebase in Sourcetree. In SourceTree version 2.5.5.0 there is an option for that.
0 Comments
Read More
Leave a Reply. |