1. on server "git init --bare"

  2. on local, "ssh-copy-id server_ip"

  3. git clone user@ssh_server_ip:/path/to/bare_repo;  git@ssh_server_ip:/username/projectname.git;

  4. local commit readme.md, git status, git config --global.username "user"

  5. git push origin master


Also, to set up git using http, that is to set up nginx directory with basic_auth, it would allow using non ssh set up and keys, instead using username and password to auth for the repos.



git push origin --delete <branch_name>



refs:


https://theboreddev.com/use-multiple-ssh-keys-different-git-accounts/


https://esc.sh/blog/setting-up-a-git-http-server-with-nginx/


https://travishorn.com/step-by-step-guide-setting-up-a-git-repository-hosting-server




没有登录不能评论