GIT的使用

对Linux中GIT相关操作做个总结


创建仓库

分为三种方式:

  • 创建工程目录后$git init
  • $git init 工程名称
  • $git clone [url]:例如:git clone git@github.com:huguanghui/linux.git
  • Linux上本地搭建Git服务器:
1
2
git daemon --reuseaddr --export-all --enable=receive-pack --verbose --base-path=/root/GIT_local &
ufw allow 9418

注意当git push出现reject报错时, 仓库目录下执行chmod -R 777 *