如何通过TortoiseGit界面初始化远程Git仓库?
Unfortunately, TortoiseGit doesn’t have a built-in GUI feature to create remote repositories directly—the "Git create repository here..." option only initializes a local repo. Remote repo creation depends on the specific Git server you’re using (like GitHub, GitLab, or a self-hosted server), which requires interacting with that server’s API or file system, something TortoiseGit doesn’t handle natively for all platforms.
But don’t worry—there are straightforward workarounds to get your local repo linked to a new remote without too much hassle:
Workaround 1: For Hosted Git Services (GitHub, GitLab, etc.)
This is the simplest approach if you’re using a cloud-hosted service:
- Head to your Git host’s website and create a new empty repository (make sure to not initialize it with a README, .gitignore, or license—we’ll add our local files instead).
- Back on your local machine, right-click your project folder and select Git Clone... from the TortoiseGit menu.
- Paste the remote repo’s URL into the "URL" field, set the local directory to your existing project folder, then click OK. This will link your local repo to the remote.
- Now you can commit your files via TortoiseGit’s "Commit" option, then push them to the remote using the "Push" button—no manual server setup needed beyond creating the repo on the host’s site.
Workaround 2: For Self-Hosted Git Servers
If you’re running your own Git server and have SSH access, you can use TortoiseGit’s built-in terminal to create the remote repo:
- Right-click your local project folder and select Git Bash Here to open a terminal.
- Run this command (replace the placeholders with your server details):
This creates a bare repository on your server (bare repos are required for remote Git servers).ssh your-username@your-server-ip "mkdir -p /path/to/your/repo.git && cd /path/to/your/repo.git && git init --bare" - Next, link your local repo to the remote: Right-click your folder > TortoiseGit > Settings > Git > Remote. Click "Add", name the remote "origin", and paste the server repo URL (like
your-username@your-server-ip:/path/to/your/repo.git). - Now you can commit and push your local files to the remote using TortoiseGit’s standard push feature.
Note on Third-Party Plugins
Some unofficial third-party plugins might add integration for specific Git hosts, but these aren’t supported by the TortoiseGit team and can be hit-or-miss in terms of reliability. Sticking with the above methods is the safest bet.
内容的提问来源于stack exchange,提问作者Cesar Rocha

