您的位置:首页 > 其它

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

2016-09-08 13:39 375 查看
Step 1: remove all history

rm -rf .git


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

git init
git 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_folder
git init
git remote add origin <github-uri>
git add .
git commit
git push -u origin master


Create a new repository

git clone <github-uri>
cd cavi_web
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: