前提:安装git和注册github账号。

操作如下:

如何将代码存放在GitHub上

从github下载代码:

Git获取代码
git clone 找到下载代码的仓库地址:如图

如何将代码存放在GitHub上

 

Git推送代码到仓库
git init // 初始化版本库
git add . // 添加文件到版本库(只是添加到缓存区),.代表添加文件夹下所有文件
git commit -m "first commit" // 把添加的文件提交到版本库,并填写提交备注
git remote add origin 你的远程库地址 // 把本地库与远程库关联
git push -u origin master // 推送代码

git pull --rebase origin master //拉取代码

相关文章:

  • 2021-06-15
  • 2022-01-07
  • 2021-07-09
  • 2021-06-14
  • 2022-01-07
  • 2022-01-07
猜你喜欢
  • 2021-12-16
  • 2021-09-01
  • 2021-05-28
  • 2021-12-26
  • 2021-11-30
  • 2021-09-30
  • 2021-04-05
相关资源
相似解决方案