標籤:style http color ar for 檔案 sp div on
//建立本地倉庫mkdir git_root;cd git_root;git init ////查看git status .git loggit log ./kernel/driver/git show 17228ec1630f6b47983870b3eddc90d4088dcc88 --name-only//下載
git clone https://github.com/wh19910525/my_often_shell.git git branchgit branch -agit checkout branch1 //switch to an local branchgit checkout -t remot_branch2 //download and switch to an remote branchgit checkout /kernel/driver/ //將指定目錄下的檔案還原成伺服器上的內容
//提交git add .git commit -m "this my first commit"git pullgit push//恢複修改git checkout -- hardware/realtek/rtl_8723bs/8723bs.mod.c //discard this filesgit reset //產生補訂git format-patch -1 hash // git format-patch -1 300830d0286bceca191d926bc2cf4d08cc58b813 git diff drivers/idle/intel_idle.c > liuxd_test_patchgit am xx.patchpatch -p1 < test1.patch // a/該目錄patch -p2 < test1.patch // a/b/該目錄建立分支//new branchgit branch // listgit branch my_new_branch // add a new branch at localgit checkout my_new_branch // switch to local branchgit push origin my_new_branch:my_new_branch //push to remote server.
//git revert 9ca532610fa179911b23e244c96db10c140639f2 // 取消某次提交
//git checkout . // 還原(覆蓋)本地的修改
//git cherry-pick 9ca532610fa179911b23e244c96db10c140639f2 //將遠程分支對應的補丁打過來。git clean -df //delete所有未跟蹤的目錄及檔案
刪除分支:
1 刪除遠程分支
$ git push origin :branchName
2 刪除本地分支,強制移除用-D
$ git branch -d branchName
常用git命令集