年纪大了,最近总是提笔忘字。 一直以来使用github都是用命令行操作,为了防止忘记,笔记一下。
克隆git上的工程到本地
git clone https://github.com/XXXX
查看本地的branch信息
git branch
查看远程的branch信息
git branch -r
查看所有的branch信息
git branch -a
删除branch分支
git branch -d ***
将删除分支推送到服务器
git push origin :***
新建branch分支
git branch ***
切换到branch分支
git checkout ***
将新建分支推送到服务器
git push origin ***
添加新文件
git add .
删除文件
git remove **
提交文件
git commit -m 'by who do what'
push到服务器
git push
pull到本地
git pull
查看本地git状态
git status
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://aiguor.com/notes/79.html
果博