I\'m using remote git repository. I successfully commit my files and now I\'m trying to push it up to stream.
Operation fails with this messasge:
git
If you use a HTTP URL, you cannot push data via HTTP. HTTP is for read only access. Use ssh instead.
Do git remote -v
to check if your repository URL is a HTTP one.
You can change this URL by doing this git remote set-url origin ssh:user@server/dir/project.git
After that, you can push!
Do check the permissions on the remote/origin repository. Are they writeable by the git user? If not, you will get this error. Something like:
chown git_user.git_user -R /path/to/repo/your_funky_repo
should do the trick on *nix systems. If your remote is on windows, I am sure there's something equivalent you could run.
I successfully pushed it using "git push —no-thin origin HEAD
"
Sometimes when we execute git push to push a new branch to a remote repository, it will be blocked by the remote repository.
Maybe we don't have the appropriate permissions. However, when I add the --no-thin
parameter to git push, I can push it up.
However, this command may be affected by different levels of permissions, so there is no guarantee that it will be pushed. But I succeeded with this push.
I encountered this problem when I set up a fresh remote server and created the remote git repo/folders with my root
user (rather than my personal user acct). Problem fixed by deleting the git repos and redoing them with my personal account. all works as expected now.
Also check if your disk is not full. I ran into the same problem on one of my VPS few minutes ago.
On my (gitlab) server, I needed first to chown -R git:git repositories/ , but git repack did not work. The issue was solved when I used scp to copy the object file from my local repo to the server:
scp .git/objects/0d/449dd91d8c20c1820d1284371b28637e08a0f3 root@server:/home/git/repositories/my/project.git/objects/0d/