- git commit修改时间、作者
git commit --amend --date=‘2023-01-12T11:37:00’
或date -R,然后git commit --amend --date=‘Fri, 06 Jan 2023 06:46:01 +0000’
git commit --amend --author=xxx - 用[指定分支][指定路径(必须有)]覆盖[当前分支][指定路径]下的内容:
git checkout another_branch – code_directory - 回滚merge提交
git revert -m 1 <merge commit的SHA1码> - 删除分支
git branch -d 会在删除前检查merge状态(其与上游分支或者与HEAD)
git branch -D 是git branch --delete --force的简写,它会直接删除
删除远程分支以及追踪分支:git push origin --delete branch - 覆盖本地变更
git pull remote remote_branch:local_branch -f - 从某个commit创建分支
git checkout commit_id -b branch_name