随笔分类 -  git

摘要:gitlab太大了,16g的机器也只是刚好能跑~~功能虽然多,但是小公司不一定用得到,这时候gitea的好处就展示出来了 中文文档地址 https://docs.gitea.com/zh-cn/1.19/category/installation 写的很清楚 二进制下载地址 https://gith 阅读全文
posted @ 2025-10-30 10:35 朝阳1 阅读(9) 评论(0) 推荐(0)
摘要:git add 之后 如何撤销 1. 使用git reset命令: git reset HEAD <文件名> 这个命令将会将文件从暂存区中移除,但是保留对文件的修改。 2. 使用git restore命令: git restore –staged <文件名> 这个命令将会将文件从暂存区中移除,但是保 阅读全文
posted @ 2024-12-13 14:09 朝阳1 阅读(223) 评论(0) 推荐(0)
摘要:例如.env 修改 .gitignore # 加入 .env 执行命令 git rm --cached .env git commit -m "Remove .env from repository" git push 阅读全文
posted @ 2024-10-11 10:14 朝阳1 阅读(15) 评论(0) 推荐(0)
摘要:方法1 直接在git后台设置xxx分支为保护分支就可以了,比如master 方法2,进入到项目文件夹 cd .git/hooks/ cp pre-commit.sample pre-commit 在最前面加上代码,master可以替换对应分支 #!/bin/sh branch="$(git rev- 阅读全文
posted @ 2024-06-18 14:33 朝阳1 阅读(209) 评论(0) 推荐(0)
摘要:老是忘记 还是做个笔记把 命令,email@email.com替换成自己的邮箱 ssh-keygen -t rsa -C "email@email.com" 生成公钥位置 windows C:\Users\[用户名]\.ssh linux ~/.ssh 把id_rsa.pub的内容,复制到git的后 阅读全文
posted @ 2024-06-03 11:19 朝阳1 阅读(7) 评论(0) 推荐(0)
摘要:报LFS错 错误1 WARNING: Authentication error: Authentication required: LFS only supported repository in paid enterprise. 错误2 batch response: LFS only suppo 阅读全文
posted @ 2024-05-11 09:29 朝阳1 阅读(656) 评论(0) 推荐(0)
摘要:项目范围 git config core.fileMode false 也可以在git的全局范围内生效 git config --global core.filemode false 也可以通过修改 “~/.gitconfig” 文件,在其中添加下面内容 [core] filemode = fals 阅读全文
posted @ 2024-04-03 13:49 朝阳1 阅读(68) 评论(0) 推荐(0)
摘要:如果.gitignore文件不存在,在项目的根目录下创建一个名为.gitignore的文件,并在该文件中添加以下内容: .idea/ 如果.idea文件夹已经被跟踪,运行git rm --cached .idea来从Git跟踪中移除它,然后再提交这个更改。 git rm -r --cached .i 阅读全文
posted @ 2024-03-29 14:22 朝阳1 阅读(325) 评论(0) 推荐(0)
摘要:注意 gitlab跟runner版本要一致,不然会出问题 docker安装gitlab cd /opt/ mkdir gitlab export GITLAB_HOME=/opt/gitlab 由于官方版本的gitlab/gitlab-ce:latest创建runner老是404,后来装了jh版本的 阅读全文
posted @ 2024-03-07 14:00 朝阳1 阅读(36) 评论(0) 推荐(0)
摘要:如果您已将公钥添加到GitLab,并且仍然每次都要求输入用户名和密码,这可能是由于使用了HTTPS URL而非SSH URL来访问GitLab仓库。 当使用HTTPS URL时,GitLab将要求输入用户名和密码来进行身份验证,即使您已将SSH公钥添加到GitLab中。要解决这个问题,您需要将仓库的 阅读全文
posted @ 2023-10-16 16:04 朝阳1 阅读(789) 评论(0) 推荐(1)