84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
几种情况:
增加了几个文件, 没有 add, 不想保存文件, 怎么快速清除文件?
add
增加了 add 了文件, 不想保存文件, 怎样清理?
修改了文件, 没有 add, 怎样清理?
修改了文件, 已经 add, 怎样清理?
欢迎选择我的课程,让我们一起见证您的进步~~
git clean -f
-d
git reset --hard
git reset
git checkout .
git checkout -f
-- -- start file arguments -b -- create a new branch based at given commit -B -- create or update branch based at given commit --conflict -- same as --merge, using given merge style --force -f -- force branch switch/ignore unmerged entries --merge -m -- 3way merge current branch, working tree and new branch --no-track -- override the branch.autosetupmerge configuration variable --orphan -- create a new orphan branch based at given commit --ours -- check out stage #2 for unmerged paths --patch -p -- interactively select hunks in diff between given tree-ish a --quiet -q -- suppress feedback messages --theirs -- check out stage #3 for unmerged paths --track -t -- set up configuration so pull merges from the base commit
git status -s | awk '$1 = "?" { print $2 }' | xargs rm -v
git clean -f
(-d
if you have new directory )git reset --hard
( orgit reset
then back to 1. )git checkout .
( or specify with file names )git reset --hard
( orgit reset
then back to 3. )git clean -f
git checkout -f
git checkout -f
orgit checkout .
git checkout -f
git status -s | awk '$1 = "?" { print $2 }' | xargs rm -v
git reset --hard
git reset --hard
git reset --hard