删除github上面的历史提交记录

如果不小心提交github提交错了,而 --amend 也不能修改提交者的信息,可以通过尝试下面的方式 Checkout bash 1 git checkout --orphan <latest_branch> Add all the files bash 1 git add -A Commit the changes bash 1 git commit -am "commit message" Delete the branch bash 1 git branch -D main Rename the current branch to main bash 1 git branch -m main Finally, force update your repository bash 1 git push -f origin main 缺点是:所有该分支的提交记录都将被删除 Reference how to delete all commit history in github?...

 ·  · 

git在windows上常用配置

Windows git “warning: LF will be replaced by CRLF” [1] bash 1 git config --global core.autocrlf false Disable Credential Manager bash 1 2 3 4 5 git config --global credential.modalprompt false git credential-manager remove -force git credential-manager uninstall --force Multi account management [2] step1: clean globle setting bash 1 2 git config --global --unset user.name git config --global --unset user.email step2: change config file only ssh bash Do not Pop-ups authtication [3] This question is the git shell prompt input user and password in an openssh popup on windows plateform...

 ·  · 

awesome git command

Tag command describe git tag 列出所有tag git tag -l v1.* 列出符合条件的tag(筛选作用) git tag [tag_name] 创建轻量tag(无-m标注信息) git push REMOTE TAG 推送一个tag到远端 git push origin –tags* 推送所有本地tag到远程 git push origin :refs/tags/[REMOTE TAG] git push –delete REMOTE TAG 删除远程指定tag git fetch origin [remote_tag_name] 拉取远程指定tag git show [tag_name] 显示指定tag详细信息 git push origin [local_tag_name] 推送指定本地tag到远程 git tag NEW_TAG OLD_TAG git tag -d OLD_TAG 重命名本地tag git tag -d [local_tag_name] 删除本地指定tag git ls-remote –tags origin 查询远程tags git tag -a [tag_name] 创建含注解的tag git fetch origin [remote_tag_name]git checkout [remote_tag_name] git branch checkout远端tag到本地 Checking 检查工作目录与暂存区的状态...

 ·  ·