What is additional "onto" button in TortoiseGit Rebase? - windows

In TortoiseGit->Rebase window has these two selectors :
What is the purpose of Onto selector, while in Upstream you already select the branch you are rebasing onto.

The onto option can be used to rebase some commits that are between the branch and the upsteam onto some other branch.
Onto in the Git docs: https://git-scm.com/docs/git-rebase#Documentation/git-rebase.txt---ontoltnewbasegt

Related

Rearrange Git branches in Xcode?

I use Xcode's built-in Git/Hub integration for day-to-day use. In one project I made a branch, and when you use Commit... Push to remote", you are asked to select which branch to push to.
The problem is that the branch, which is used only rarely, is the first entry in the push pop-up. I often check into the wrong branch during a push simply because I don't notice it is the default selection.
Is there any way to sort these entries, or temporarily mark one so it does not appear or is greyed out? You cannot drag them in the source control pane on the left and there do not appear to be any options anywhere.

Switch / Checkout from Git Synchronization dialog

I need to do a lot of switching between branches from a remote repository to inspect code, perform code reviews, contribute to other developers' work and such. I'm not a command line fan so I use TortoiseGit almost exclusively. I also prefer TG over Git clients in various IDEs because I find it really shines when you run into more complex operations like non-trivial three-way merges.
I noticed I find myself clicking A LOT, though. To switch to another branch consists of: Revert or stash any current local changes, fetch (to get the latest remote branches), switch/checkout. So I started looking into the "Git Synchronization" dialog, hoping that I could perform all those operations from within one dialog with a few less clicks, dialogs and OKs.
However, I simply cannot find the switch (or checkout) functionality in that dialog. Is that simply missing, or is there some other Git operation or combination of operations that accomplishes the same?
Quick solution
You can simply select a different branch from Local Branch dropdown in Git Sync dialog. When you subsequently invoke Pull, TortoiseGit will force the checkout automatically:
For other operations (Fetch, Push) switching to a branch is not necessary. However be cautious with the Commit and Show log buttons as they will always apply to the current branch (not the branch selected in Local Branch dropdown) and no checkout will be forced.
Solution using Switch/Checkout dialog
If you need to use full Switch/Checkout dialog TortoiseGit dialog, you can use Browse references dialog which you can invoke from Git Sync dialog by clicking on the ellipsis button next to the Local Branch dropdown.
In the Browse references dialog there is a list of available branches. You should right click the desired branch you want to checkout and select Switch/Checkout to this from context menu. Switch/Checkout dialog will pop up. After completing the checkout, return to the Browse references dialog where the desired branch is selected and click OK. Now the desired branch is checked out and also selected as a Local Branch in Git Sync dialog.

How can I get my stashed files back to where it was before stash?

I got a pop-up in my git "The current working tree is not clean. do you want to stash the changes?" It had two options stash and abort i selected "stash" now I don't see my previous changes in my commit list how can I get my changes back? Please answer emergency!!!!!!
Open the context menu in explorer on the repository. Then go to the TortoiseGit submenu and select "Stash Pop".
cf. https://tortoisegit.org/docs/tortoisegit/tgit-dug-stash.html
use below command to get back the stashed files :
git stash pop

How do you auto-push commits to remote repository in TortoiseGit?

I have set up a remote repository with the URL, the credentials (accounts) set up for that repository, and I have my local branch ready to push new commits to the repository.
Now, I would like to auto-push my commits to the remote repository in TortoiseGIT, after committing my changes.
Below shows how to set up the configurations in TortoiseGIT for auto-pushing commits.
Using the default installation and configurations for TortoiseGIT v2.3.0.0 and Git for Windows 2.11.0.windows.1:
Prepare your commit.
Do Right click > Commit... and it should open up the Commit dialog.
Once your commit messages are typed in, at the bottom, select the dropdown menu on the Commit button, and choose Commit & Push.
It should then open up the Push dialog.
In the Push dialog, in the Ref section, choose the remote branch via the dropdown menu, or type in the remote branch name. It must not be empty.
Change the Destination section if necessary.
In the Options section, enable the bottom-most option: Always push to the selected remote branch for this local branch.
Press OK.
Your commit will then be pushed to the repository. Subsequent commits will automatically be pushed to the repository once you commit your changes.

How to change default action for "pushing" after committing?

After committing some code locally in TortoiseGit, the window that shows that the operation was successful offers to push the commit (or, in fact, any local commits) to a remote repository. This can be achieved by clicking a button with a dropdown arrow, from where Push, or some other actions can be chosen.
Normally, Push is shown by default, the other actions have to be selected from said dropdown menu.
I am now looking at a repository that was originally imported from SVN (using TortoiseGit). After importing all commits, I have manually reconfigured the remote master to point to a different, true Git repository.
However, after committing, the default action of the aforementioned button is always SVN DCommit for this repository, even after choosing Push several times.
How can I change the default action to Push?
The default of the post action button cannot be changed right now (as of version 2.3.4; see https://tortoisegit.org/issue/2227).
The "DCommit" entry is only shown for Git repositories which have an SVN remote. When you remove the SVN connection the default will be "Push".
Also, with a recent version of TortoiseGit the "OK" button of the commit dialog is a drop down menu where you can select "Commit & push" which should save you a click...

Resources