简体   繁体   中英

Issues pushing to private git repositories in linux

Hi I have the following git private repo

git remote -v
origin  https://github.com/sescobb27/festinare_api.git (fetch)
origin  https://github.com/sescobb27/festinare_api.git (push)
ssh git@github.com:sescobb27/festinare_api.git (fetch)
ssh git@github.com:sescobb27/festinare_api.git (push)

but when I try to run git push origin master it says

remote: Repository not found.
fatal: repository 'https://github.com/sescobb27/festinare_api.git/' not found

but if instead I run git push ssh master it works, I don't know what's going on or why is that happening; the weird thing is that the last week they were working.

I'm on xubuntu xfce 14.04LTS

UPDATE

git config --local -l

core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
credential.helper=store
remote.origin.url=https://github.com/sescobb27/festinare_api.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
remote.ssh.url=git@github.com:sescobb27/festinare_api.git
remote.ssh.fetch=+refs/heads/*:refs/remotes/ssh/*

An https push should ask for your credentials (github login ' escobb27 ', and GitHub password): it should work then.
If it does not ask for credentials, then it might pick some from a credential helper which could cache the wrong credentials.
In any case, a private repo with incorrect credentials will always return " 404: not found ".

An ssh push would work directly because the public ssh key which authenticate you has been added to the private repo on GitHub.

I advised in the comments to try, suspecting some error in the .gitconfig :

git remote set-url origin https://sescobb27@github.com/sescobb27/festinare_api

And the OP confirms:

I already fix it, there was an error in my .gitconfig file, once I fixed it git started working as expected, but the error wasn't obvious

I think the error was indentation and mixed tabs with spaces, but I'm not sure. didn't have vim configured to translate tabs to spaces so that makes the mess.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM