1、安装Git
sudo apt install git
2、配置Git
用户和邮箱:
git config --global user.name "xxx" git config --global user.email xxx@163.com
文件eof设置:
git config --global core.autocrlf false #不要自动将lf转成crlf
缓存远程仓库账户:(只在类Unix系统下有效)
git config --global credential.helper cache git config --global credential.helper 'cache --timeout=2500000'
或者保存远程仓库账户(慎用):
git config credential.helper store --file=.git_credentails
3、配置Git快捷键组
Alt+G,Alt+S:查看仓库状态Status。
Alt+G,Alt+R:回滚修改Reset或Revert。
Alt+G,Alt+C:提交Commit。
Alt+G,Alt+U:从远程拉取Pull。
Alt+G,Alt+P:推送到远程Push。
Alt+G,Alt+L:查看当前文档Log。
其它快捷键组:
4、配置注释模版
Tools > Options > Text Editor > Snippets
headerclass:
/******************************************************** [DateTime]:$YEAR$.$MONTH$.$DAY$ [Author ]:Mr.Huang [Email ]:airscrat(at)qq(dot)com [Contents]: *********************************************************/
headerfunction:
/** $Contents$ */
然后在编辑器用输入"headerclass"或"headerfunction"就可以使用。
5、停用文件名小写的设置
选项->C++->文件命名->不勾选lower case file names
6、git提取差异文件打包:
git log #查看日志中的head
git diff head1 head2 --name-only | xargs tar -czvf update.tar.gz
#比较两次提交的差异文件,并打包。
附2:git解决所有冲突后:
git add .
git push
7、程序自动化布署
设置:项目->Run->添加Deploy Configuration->windeployqt.exe->app.exe->directory。
布署:构建->布署。就可以看到Qt相关的dll和文件都自动拷贝到了bin目录。