Search code examples
windowsgitpushgit-pushtortoisegit

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.


Solution

  • Using the default installation and configurations for TortoiseGIT v2.3.0.0 and Git for Windows 2.11.0.windows.1:

    1. Prepare your commit.
    2. Do Right click > Commit... and it should open up the Commit dialog.
    3. Once your commit messages are typed in, at the bottom, select the dropdown menu on the Commit button, and choose Commit & Push.
    4. It should then open up the Push dialog.
    5. 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.
    6. Change the Destination section if necessary.
    7. In the Options section, enable the bottom-most option: Always push to the selected remote branch for this local branch.
    8. 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.