0
点赞
收藏
分享

微信扫一扫

linux搭建个人git服务器

雨鸣静声 2022-03-16 阅读 92

linux搭建个人git服务器

  1. 创建git用户,设置.ssh.ssh/authorized_keys
  2. 创建远程仓库,并且初始化
mkdir project
cd project
mkdir test1_repo.git
cd test1_repo.git
git --bare init  # 必须是bare
  1. 初始化本地仓库
git init
git add .
git commit -m "first push"
  1. 关联远程仓库并推送
git remote add origin git@$(ip):/home/git/project/test1_repo.git
git push origin master

观察

github仓库地址:git@github.com:user_name/repo_name.git
我们的仓库地址:git@$(ip):/home/git/project/test1_repo.git

举报

相关推荐

0 条评论