發表文章

目前顯示的是 2月, 2017的文章

Git 常用指令

Repository clone git://Repository 可以透過clone或init建立repository git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git or git init test_folder add git://repository 在一個Repository加入新的Repository. 範例: 在一個linux Repository(linux org)加入另一個來源不同的linux Ropository(TI) git remote add ti-linux git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git subtree [add|merge|pull|push|split] --prefix=&lt prefix &gt [&lt commit &gt|&lt repository &gt &lt ref &gt|&lt commit...&gt] 在此repository加入一個已存在的repository,使其成為subfolder. 通常可以看作是把子專案放在大專案底下 範例:新增一個已存在repository於當前repository底下的src子目錄(prefix=src) git subtree add --prefix=src ../src master remote -v 顯示有連接到的remote repository url git remote -v Branch branch -vv 查看remote branch與local branch對應關係. git branch -vv or git remote show origin Restore reset <--hard|--soft|-mixed> commit-id 還原至某個commit id狀態 --hard: working tree, index/cache, Repository全部還原 --soft:保留working