Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

删除Github仓库所有commit记录(译) #9

Open
lishuhao opened this issue May 25, 2019 · 0 comments
Open

删除Github仓库所有commit记录(译) #9

lishuhao opened this issue May 25, 2019 · 0 comments

Comments

@lishuhao
Copy link
Owner

新建orphan分支

git checkout --orphan latest_branch

将需要的文件添加到暂存区

git add -A

Commit

git commit -m "..."

删除master分支

git branch -D master

将当前latest_branch分支重命名为master分支

git branch -m master

最后,推送到远程仓库

git push -f origin master


原文

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant