
- 在远程创建
Git仓库并复制地址# 例如在GitHub上创建仓库并有如下地址 https://github.com/xxx/test.git - 进入本地工作目录并初始化为
Git目录cd xxx/work/ git init - 为本地
Git目录添加远程仓库的URL# 将第一步的地址添加到这里 git remote add origin https://github.com/ldjhust/test.git - 提交本地目录到远程仓库
# 第一次提交必须说明提交到哪一个远程仓库以及分支,否则会出现: No refs in common and none specified; doing nothing. git add . git commit -m "Initial commit" git push origin master