1. 程式人生 > >Git我也沒怎麽懂

Git我也沒怎麽懂

com git reset upload git pull rac rep load 執行 check

先說經常遇到的的:Your branch is ahead of ‘origin/master‘ by 1 commit

這種情況下,執行repo sync是不行的,因為有未提交的內容。所以要麽就把它repo upload,要麽就:

git reset HEAD~1 有幾次就幾個commit,HEAD後面就跟幾次。

然後全部清除掉。

2.對於reset出現的not staged文件

如果那個文件是新添加的,可以直接git clean -f 。

如果那個文件已經有了,可以checkout那個文件,然後會出現一個commit未提交。再執行git pull --rebase

3.untracked file

git clean -f

4.Changes not staged for commit

git checkout

Git我也沒怎麽懂