-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Description
根据个人使用情况,不定时更新
撤销 git add
- 被git add 的文件退出暂存区, 但是修改保留
git reset --mixed- git reset 默认 --mixed,所以可以使用git reset HEAD
git reset HEAD代码找回
- 本地代码commit 但是未提交(reset --hard等操作造成代码丢失)时,代码找回
git reflog - 撤下到之前状态
git reset --hard HEAD^ //上一个commit
git reset --hard id更新master到gh-pages分支
git checkout gh-pages // go to the gh-pages branch
git rebase master // bring gh-pages up to date with master
git push origin gh-pages // commit the changes
git放弃本地,强制覆盖本地代码
$ git fetch --all
$ git reset --hard origin/master
$ git pull删除远程分支文件夹,保留本地文件夹
git rm --cached -r xxx
git commit -m "remove file from remote"
git push -u origin master
发布项目到git-pages
git branch gh-pages
git checkout gh-pages
git rm -rf .
git add .
git commit -m "git pages"
Reactions are currently unavailable