So I got a git repository set up in Visual Studio. Commits etc work fine. It’s seemingly able to pull from the repository fine (no errors, at least) but cannot push. I get an error about invalid remote name which doesn’t make sense. Here’s the output:
<code>Pushing master
Invalid remote name "origin": invalid remote name: "F:\<git_repo_path_on_disk>\origin"
Error: failed to push some refs to 'https://github.com/<correct_repo_url>.git'
Error encountered while pushing to the remote repository: PushCommand.ExecutePushCommand
Failed to push to the remote repository. See the Output window for more details.
</code>
<code>Pushing master
Invalid remote name "origin": invalid remote name: "F:\<git_repo_path_on_disk>\origin"
Error: failed to push some refs to 'https://github.com/<correct_repo_url>.git'
Error encountered while pushing to the remote repository: PushCommand.ExecutePushCommand
Failed to push to the remote repository. See the Output window for more details.
</code>
Pushing master
Invalid remote name "origin": invalid remote name: "F:\<git_repo_path_on_disk>\origin"
Error: failed to push some refs to 'https://github.com/<correct_repo_url>.git'
Error encountered while pushing to the remote repository: PushCommand.ExecutePushCommand
Failed to push to the remote repository. See the Output window for more details.
Here’s the .gitconfig
:
<code>[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
[diff]
tool = vsdiffmerge
[difftool]
prompt = true
[difftool "vsdiffmerge"]
cmd = "F:\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\vsdiffmerge.exe" "$LOCAL" "$REMOTE" //t
keepBackup = false
[merge]
tool = vsdiffmerge
[mergetool]
prompt = true
[mergetool "vsdiffmerge"]
cmd = "F:\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\vsdiffmerge.exe" "$REMOTE" "$LOCAL" "$BASE" "$MERGED" //m
keepBackup = false
trustExitCode = true
[lfs "https://github.com/<git url>/info/lfs"]
access = basic
[remote "origin"]
url = https://github.com/<git url>.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
</code>
<code>[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
[diff]
tool = vsdiffmerge
[difftool]
prompt = true
[difftool "vsdiffmerge"]
cmd = "F:\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\vsdiffmerge.exe" "$LOCAL" "$REMOTE" //t
keepBackup = false
[merge]
tool = vsdiffmerge
[mergetool]
prompt = true
[mergetool "vsdiffmerge"]
cmd = "F:\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\vsdiffmerge.exe" "$REMOTE" "$LOCAL" "$BASE" "$MERGED" //m
keepBackup = false
trustExitCode = true
[lfs "https://github.com/<git url>/info/lfs"]
access = basic
[remote "origin"]
url = https://github.com/<git url>.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
</code>
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
[diff]
tool = vsdiffmerge
[difftool]
prompt = true
[difftool "vsdiffmerge"]
cmd = "F:\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\vsdiffmerge.exe" "$LOCAL" "$REMOTE" //t
keepBackup = false
[merge]
tool = vsdiffmerge
[mergetool]
prompt = true
[mergetool "vsdiffmerge"]
cmd = "F:\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\vsdiffmerge.exe" "$REMOTE" "$LOCAL" "$BASE" "$MERGED" //m
keepBackup = false
trustExitCode = true
[lfs "https://github.com/<git url>/info/lfs"]
access = basic
[remote "origin"]
url = https://github.com/<git url>.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
Pushing via command line seems to work fine. Git remote settings in Visual Studio seem fine. I assume I must have something misconfigured but can’t figure out exactly what.
3