github 简单使用

作为一个码农,保管好自己的成果很重要,今天一不小心,辛辛苦苦写的android项目飞了,准备把尘封已久的github重新用起来

1新建一个分支

2.在本地创建一个文件夹

3发现错误,删除创建的分支 git remote rm <name>  这里 name=origin

4.添加一分支

git remote add origin https://{name}:{password}@github.com/{name}/项目名.git

5.git push -u origin master//提交 远程分支

在本地新建一个分支: git branch Branch1
切换到你的新分支: git checkout Branch1
将新分支发布在github上: git push origin Branch1
在本地删除一个分支: git branch -d Branch1
在github远程端删除一个分支: git push origin :Branch1   (分支名前的冒号代表删除)

直接使用git pull和git push的设置

git branch --set-upstream-to=origin/master master 
git branch --set-upstream-to=origin/ThirdParty ThirdParty
git config --global push.default matching

原文地址:https://www.cnblogs.com/yuluhuang/p/3945764.html