如何将代码上传(更新)到 github

  1. 在 github 上新建一个存放项目代码的仓库

  2. 在本地项目代码文件夹建立本地仓库,右键 "Git Bash Here"

git init
  1. 添加需要上传的文件到本地仓库:
git add *

查看添加状态:

git status
  1. 将 add 的文件 commit 到仓库:
git commit -m "the first commit"
  1. 将本地的仓库关联 github:
git remote add origin [项目的 github 地址]
  1. 代码合并(pull = fetch + merge)
git pull
  1. 上传代码
git push

你可能感兴趣的:(如何将代码上传(更新)到 github)