宗小宗-PHP程序猿

欢迎各位朋友前来,如果我的文章中有不对的地方,还望指正;如需转载,请注明原处

git常用命令

下载私有项目 git clone https://username:password@github.com/xxx/xxx.git /var/www/xxx

创建分支 git branch test

将分支提交到远程 git push origin test:test

查看远程分支 git branch -r

查看各分支的最后一次提交 git branch -v

切换分支 git chekout 分支名

提交代码到分支 git push origin test

 

整个文件夹提交 git add /var/www/git/

长期保存密码: git config --global credential.helper store  //执行这个命令后,第一次提交需要输入用户名密码,以后就不需要了

设置记住密码:git config --global credential.helper cache //默认15分钟

设置记住密码时间:git config --global credential.helper 'cache --timeout=3600' //设置一个小时内有效

删除文件:git rm -f 文件; git commit; git push;

posted @ 2016-06-07 10:16  宗小宗  阅读(161)  评论(0编辑  收藏  举报