1

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?

O. R. Mapper
  • 18,591
  • 9
  • 58
  • 102

1 Answers1

0

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...

MrTux
  • 28,370
  • 24
  • 91
  • 123
  • '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".' - weird. I do not have an SVN remote. The only remote is a Git repository. At first, that remote was created by replacing the SVN URL with a Git URL. But now, I deleted that and created a new remote with the Git URL again, and the button still defaults to *SVN DCommit*. However, I do see that there is an `svn` subdirectory in the repository's `.git` folder. – O. R. Mapper Nov 24 '16 at 14:04
  • There seem to be some leftover of the old svn repository. TortoiseGIt checks for the existance of the `svn` folder in the `.git` folder where all the SVN meta data is stored which is a quite good heuristic. – MrTux Nov 24 '16 at 14:19
  • Indeed, the `settings` file also contains an SVN remote *in addition to* my Git remote. I see nowhere in the settings GUI where I could configure that, though. I might try and simply take that out of the settings manually (and remove the `svn` subdirectory), but I'd also like to know the "official" way to achieve this via TortoiseGit, and to make sure I am not leaving any more traces lying around - based upon [this issue](https://gitlab.com/tortoisegit/tortoisegit/issues/2335), it doesn't necessarily seem easy to achieve. – O. R. Mapper Nov 24 '16 at 14:41
  • I am not aware of a clean solution. You could try the manually delete the svn configuration in `.git/config` and then delete `.git/svn`and some leftover refs; or you create a fresh clone. – MrTux Nov 24 '16 at 15:27
  • Creating a fresh clone ... that rings a bell. I think that's what I did when converting SVN to Git repositories before. Unfortunately, this time, I have already started developing after the repo conversion, so I am having several branches around, and [based upon a thus-related question](http://stackoverflow.com/questions/67699/how-to-clone-all-remote-branches-in-git), I am still a bit unclear about how to clone a repository *with all branches* rather than just one branch of it. (In the linked question, plenty of people propose plenty of solutions and plenty of explanations why each of the ... – O. R. Mapper Nov 24 '16 at 22:21
  • ... solutions is dysfunctional in one way or another). – O. R. Mapper Nov 24 '16 at 22:22
  • Ok, given that my branch count was relatively low, I ended up [getting the branches one by one](http://stackoverflow.com/a/17328671/1430156). In the new clone, the default action is *Push*. So, creating a fresh clone ultimately solved the problem. (I've accepted your answer as it is, but for future visitors, it won't hurt if you amend it by this extra clue.) – O. R. Mapper Nov 24 '16 at 22:59