电脑上无项目,需重新从github上下拉更新再上传;
1、桌面创建空文件夹
2、终端打开文件夹
cd 文件夹地址
3、给文件夹创建git
git init
4、下拉github项目代码
git pull 【git项目地址】 master
5、更新代码
6、添加所有代码到缓冲区
git add .
7、提交代码
git commit -m "更新说明"
8、讲更新的代码上传到github
git push 【git项目地址】 master
创建新分支
1、创建本地新分支test,并切换到test新分支下
git checkout -b test

//查看本地分支
git branch
//查看远程和本地分支
git branch -a

2、创建远程分支,远程分支与本地分支可以同名也可不同名(当然可以随意起名)
//orgin后面跟的第一个test为本地分支名,冒号后面的test为给远程分支起的名
git push origin test:test

常见问题
1、fatal: 'origin' does not appear to be a git repository
git remote add origin git的地址
再次push提交就可以了
网友评论