跳转至

GitHub - 初始化仓库

创建仓库

首先在 GitHub 上创建一个空仓库,然后在项目目录下执行:

git init
git add .
git commit -m "first commit"
git remote add origin https://github.com/xxxx/xxxx.git
git push -u origin master

在其他电脑继续工作

git clone https://github.com/xxxx/xxxx.git

想要推送代码那跟下面一样需要身份认证

如果仓库是私有的 可以创建一个github personal access tokens 验证
https://github.com/settings/tokens
创建时候权限中 选择 repo 就可以。

#<access_token> 这个部分写 token 
git clone https://<access_token>@github.com/xxxx/xxxx.git