![]() ![]() (2) I culled a lot of old local branches from all 4 repos that were "clutter" as far as I was concerned. I upgraded in the hope that it would make it go away. Would have been 2 if not 3 versions behind. (1) Have recently upgraded the Sourcetree. Of the 4, 1 behaves itself while the other 3 duplicate every local branch. Certainly, they are all configured to connect to Sourcetree in the same way. The 4 repos are much the same: nothing about any one of them is inherently different to the other 3 in terms of credentials, git, etc. I have 4 Gitlab repos that I connect Sourcetree to. So, using v2.3.1.0 (latest) on Windows 7. ![]() This script will update stable branch as well if it exists.Sorry for the messed-up posting, not sure why the one screenshot got pasted several times. Normally, before submitting a pull request, we will update master (handy with this script) and rebase change on top of it git rebase master. This allows you to update master branch from a different branch without having the checkout the master branch first. The command saves your local modifications away and reverts the working directory to match the HEAD commit. Use git stash when you want to record the current state of the working directory and the index, but want to go back to a clean working directory. This is a similar idea with git stash, however, I prefer seeing everything in my tree :) You can call this script multiple time to undo multiple commits. Just in case we call this script by mistake, the script will make a zombie branch before undoing the last commit. And later on, after we finish the business with the other branch, we can switch back to this branch, and simply undo the last commit. Using this script, we can make a dummy commit to save the work-in-progress changes. However, we cannot do that with uncommitted changes. Sometimes we need to ad-hoc switch to a different branch. But you can specify your remote name in the parameter. This feature is especially useful when being used along with git amend in SourceTree when you have some small changes that you just want to amende to the last commit.īy default, this script will push to origin remote. ![]() This script will check if the remote branch has diverged from the local branch if it is, then a zombie branch will be created in the remote so that you won't lost any of the changes.įorce push is a handy to keep the commit history clean. When you make a mistake, then you'll lose your changes and there is no going back. However, force push is a dangerous operation since it will overwrite the history in the remote. You can enable force push from SourceTree directly. Zombie branches that are older than 1 month will be deleted. It is nicer to put the branches in folder start with letter "z" (zombie) instead of "a" (archive) because SourceTree will order the branches by lexical order. The idea is to archive a branch instead of deleting it immediately. Rename the current branch to zombie/YYYY-MMM-DD/HH-MM-SS/. During development, we can easily end up with a lot of PR branches that are merged. This is very useful for keeping the repo clean. If we want to also remove the merged branch in a remote, we can pass in the remote name as a parameter. By default, this script only deletes merged branches locally. It is recommended to select both the check boxes of "Open in Separate Window" and "Show Full Output" so that it is easier to capture errors if there is any.Īnd here are the available actions in this repo: Remove Merged Branchesĭelete all branches that are merged to current branch, master branch, dev branch or develop branch. Type in whatever you want in the Menu Caption. In SourceTree, open Preferences by ⌘ +, and then click on the "Custom Actions" tab:įrom there you can "Add", "Edit" or "Remove" custom actions for SourceTree. To use the custom actions here, simply checkout the repo on your machine. This repo contains a list of useful SourceTree custom actions.īuilding with existing git command, it extends the SourceTree functionalities.įor example, you can delete merged branches to quickly keep the remote clean Īnd you can undo the last commit if you made a mistake.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |