1. 进入github---注册、登录 ,本地安装git或者github desktop
2. 建立自己的仓库:点+ 新建仓库

3. 导入别人的项目:例如别人的代码仓库 , Fork 别人的代码

4. 这时自己github就多了Fork下来的仓库,进入仓库,选择 Clone or download,复制地址,确认网址中间是自己用户名(如果是你fork的用户名,你没有修改权限)

5. git bash 操作流程:
a. 打开git bash 进入你要放代码的文件夹命令: cd /d/mygit/ ,clone到本地 命令:git clone -b master --depth=1 加上你复制的地址(只会下载最新版的代码)
b. 添加命令 (进入文件所在位置) git add 新增文件名
c 本地提交 git commit -m "添加了XX文件,备注"
d. git push到你的github仓库(会确认账号密码)
e. 更新代码到本地: git pull
6. github desktop 操作流程:
a. 进入github desktop 登录github账号,点击Clone a repository 输入复制的地址 和你要存放的位置 点击 clone ,或者在左上角file选项中选择Clone a repository

b. 本地仓库就有clone下来的代码,新增或修改后在左下角 如图 输入你的用户名和提交描述,点击Commit to master ,然后就可在你的github仓库看到你提交的内容了

c. 将你代码仓库更新到你本地仓库 点Repository -> Pull

网友评论