git清除历史记录 并创建新项目

来源:互联网 发布:超a鞋淘宝 编辑:程序博客网 时间:2024/06/07 04:05

Step 1: remove all history

rm -rf .git

Step 2: reconstruct the Git repo with only the current content

git initgit add .git commit -m "Initial commit"

Step 3: push to GitHub.

git remote add origin <github-uri>git push -u --force origin master

Others:
Existing folder or Git repository

cd existing_foldergit initgit remote add origin <github-uri>git add .git commitgit push -u origin master

Create a new repository

git clone <github-uri>cd cavi_webtouch README.mdgit add README.mdgit commit -m "add README"git push -u origin master
0 0
原创粉丝点击