md_files/后端笔记/本地记录.md

45 lines
977 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 技巧
## 修改git提交日期
用git bash here打开不要cmd终端。
1.先提交本地修改
2.git rebase -i --root =》然后将需要修改的pick改为edit
3.GIT_AUTHOR_DATE="2025-04-08T18:11:42" \
GIT_COMMITTER_DATE="2025-04-08T18:11:42" \
git commit --amend --no-edit --date "2025-04-08T18:11:42"
注意这两个时间都要设置,删掉--no-edit可以编辑commit信息。
4.git rebase --continue 继续编辑下一个提交记录
5.git push --force origin master 提交修改到远程。
git rebase --abort 如果中途不想修改了,可以退出操作
git log --pretty=fuller -1 查看AuthorDate和CommitDate是否一致。
编辑远程Gitea中的活动记录
docker exec -it gitea bash
sqlite3 /data/gitea/gitea.db
SELECT id, name, created_unix FROM repository WHERE name = '你的仓库名'; =>获得仓库的id
SELECT id, repo_id, created_unix FROM action where repo_id=19; =>获得该仓库的所有action