阿里云服务器搭建git仓库

如何设置internal

参考:https://www.liaoxuefeng.com/wiki/896043488029600/899998870925664
在这篇文章中,有一个关键性步骤,就是创建证书登录,参考:
https://www.cnblogs.com/0xcafebabe/p/5234678.html

为了更简便,可以用以下方式搭建:https://developer.aliyun.com/article/358941

git上传与下载

这个东西反复了一两天,本来以为完美无暇的解决,可是当新建一个新的仓库时则又出现了问题。好在已经有成功的先例,所以不用过分担心。
1.服务器的设置,参考:
https://www.liaoxuefeng.com/wiki/896043488029600/899998870925664 
这个应该是没有问题的。
2.如何才能git push
这个是会出很多问题的
-无法git add .
https://www.cnblogs.com/irockcode/p/8761954.html
-如果出现:remote: error:updating the current branch in a non-bare repository is denied。
remote: error: refusing to update checked out branch: refs/heads/master
remote: error: By default, updating the current branch in a non-bare repository
remote: error: is denied, because it will make the index and work tree inconsistent
remote: error: with what you pushed, and will require \’git reset –hard\’ to match
remote: error: the work tree to HEAD.
remote: error:
remote: error: You can set \’receive.denyCurrentBranch\’ configuration variable to
remote: error: \’ignore\’ or \’warn\’ in the remote repository to allow pushing into
remote: error: its current branch; however, this is not recommended unless you
remote: error: arranged to update its work tree to match what you pushed in some
remote: error: other way.
remote: error:
remote: error: To squelch this message and still keep the default behaviour, set
remote: error: \’receive.denyCurrentBranch\’ configuration variable to \’refuse\’.
则需要将git init –bare重新初始化,同时git config receive.denyCurrentBranch warn
-如果出现:push denied
则可能是文件夹的用户权限没有修改
-如果出现明明已经上传,但pull下来,就是没有存在该文件夹,则意味这个子文件夹也是一个git子仓库。需要使用的命令:
注意是在子文件夹下:
rm -rf .git &&gitrm –cache . -f

git commit格式

参考阿里的规范:https://zhuanlan.zhihu.com/p/182553920?utm_source=org.mozilla.firefox,详细说明:https://www.jianshu.com/p/201bd81e7dc9?utm_source=oschina-app
<type>(<scope>): <subject>
type(必须)
用于说明git commit的类别,只允许使用下面的标识。
feat:新功能(feature)。
fix/to:修复bug,可以是QA发现的BUG,也可以是研发自己发现的BUG。
fix:产生diff并自动修复此问题。适合于一次提交直接修复问题to:只产生diff不自动修复此问题。适合于多次提交。最终修复问题提交时使用fix
docs:文档(documentation)。
style:格式(不影响代码运行的变动)。
refactor:重构(即不是新增功能,也不是修改bug的代码变动)。
perf:优化相关,比如提升性能、体验。
test:增加测试。
chore:构建过程或辅助工具的变动。
revert:回滚到上一个版本。
merge:代码合并。
sync:同步主线或分支的Bug。
scope(可选)
scope用于说明 commit 影响的范围,比如数据层、控制层、视图层等等,视项目不同而不同。
例如在Angular,可以是location,browser,compile,compile,rootScope, ngHref,ngClick,ngView等。如果你的修改影响了不止一个scope,你可以使用*代替。
subject(必须)
subject是commit目的的简短描述,不超过50个字符。
建议使用中文(感觉中国人用中文描述问题能更清楚一些)。
结尾不加句号或其他标点符号。

根据以上规范git commit message将是如下的格式:

feat:增加控制端ros接口

版权声明:本文为AIpower原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/AIpower/p/13992248.html