添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Then to add it as remote origin on local PC:
git remote add origin ssh:// [email protected] /home/USER/x/GIT_REPO

And do push after it:
git push remote

But I get this error
fatal: 'remote' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I can do normal SSH via ssh [email protected]

My I doing something wrong ? If s, any idea what ?
Or is this not supported by OpalStack ?

sasa_buklijas Yes, you can use SSH with Gitea.

I can't seem to reproduce the problem you're reporting. I took the following steps and everything just worked:

  1. Created a bare repo on the server:
    git init --bare /home/user/foo
  1. Created a local repo, set the origin, add a file, and push to a branch:
    mkdir ~/foo
    cd ~/foo
    git init
    git remote add origin ssh://[email protected]/home/user/foo
    echo hello > hello
    git add ./hello
    git commit -a -m "test"
    git push --set-upstream origin main
  1. The result:
    Enumerating objects: 3, done.
    Counting objects: 100% (3/3), done.
    Writing objects: 100% (3/3), 452 bytes | 452.00 KiB/s, done.
    Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
    To ssh://opalX.opalstack.com/home/user/foo
     * [new branch]      main -> main
    branch 'main' set up to track 'origin/main'.

I have followed you example and got error:
error: src refspec main does not match any
error: failed to push some refs to 'ssh://opalX.opalstack.com/home/USER/foo'

I do not know why, but my default branch is master not main.
So "git push origin master", is working fine.
My git is version 2.36.1, maybe that is why there is difference in branch names.

This "git push remote" was my mistake, got confused.

Thanks for help.

sasa_buklijas I do not know why, but my default branch is master not main.

My bad! I've got defaultBranch = main in my local .gitconfig .

If you don't have any such config then I think the default is "master".