GitHub 服务器
公司中,我们可以搭建中央服务器让项目组开发人员共享代码,但是如果我们的开发人员都是通过互联网进行协作,而不是在同一个地方,那么开发时,程序文件代码的版本管理就显得更加重要,这就需要搭建一个互联网的版本库,让不同地点的人都可以进行访问。这里我们不用自己搭建。因为GitHub网站已经帮助我们提供了共享版本库功能。
1. 创建远程新的仓库
- 这几个地方都可以创建仓库
- 创建仓库
2. 本地仓库的基本操作指令
# create a new repository on the command line
echo "# git-study" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin git@github.com:Aitiger-coffee/git-study.git
git push -u origin main
# push an existing repository from the command line
git remote add origin git@github.com:Aitiger-coffee/git-study.git
git branch -M main
git push -u origin main
3. 创建本地仓库
- 在本地选定的文件夹当中初始化仓库
# 初始化本地仓库
git init
# 设置远程仓库
git remote add origin git@github.com:XK-coding/github-test.git
4. 配置姓名和邮箱
git config --global user.name Muko
g