git commit 提交記錄git
git branch <branch_name> 創建名爲branch_name的分支spa
git checkout <name>;git commit 切換分支到name,提交 或者能夠使用一條命令切換分支 git checkout -b <name>.net
git merge <name> 合併代碼code
建立新分支 bugFix 用 git checkout bugFix 命令切換到該分支 提交一次 用 git checkout master 切換回 master 再提交一次 用 git merge 把 bugFix 合併到 master git branch bugFix git checkout bugFix 上面2句能夠修改成git checkout -b bugFix git commit git checkout master git commit git merge bugFix
新建並切換到bugFix分支 git checkout -b bugFix 提交一次 git commit 切換回master分支再提交一次 git checkout master; git commit 再次切換到bugFix分支,rebase 到master上 git checkout bugFix; git rebase master
新增文件,並提交blog
hxbjmy@hxbjmy-PC MINGW64 /f/test/test (hhh) $ ls 2.txt 3.txt 4.txt hxbjmy@hxbjmy-PC MINGW64 /f/test/test (hhh) $ touch 5.txt hxbjmy@hxbjmy-PC MINGW64 /f/test/test (hhh) $ git status On branch hhh Your branch is up to date with 'origin/hhh'. Untracked files: (use "git add <file>..." to include in what will be committed) 5.txt nothing added to commit but untracked files present (use "git add" to track) hxbjmy@hxbjmy-PC MINGW64 /f/test/test (hhh) $ git add 5.txt hxbjmy@hxbjmy-PC MINGW64 /f/test/test (hhh) $ git status On branch hhh Your branch is up to date with 'origin/hhh'. Changes to be committed: (use "git reset HEAD <file>..." to unstage) new file: 5.txt hxbjmy@hxbjmy-PC MINGW64 /f/test/test (hhh) $ git commit -m 'add 5.txt' [hhh db56b29] add 5.txt 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 5.txt hxbjmy@hxbjmy-PC MINGW64 /f/test/test (hhh) $ git status On branch hhh Your branch is ahead of 'origin/hhh' by 1 commit. (use "git push" to publish your local commits) nothing to commit, working tree clean hxbjmy@hxbjmy-PC MINGW64 /f/test/test (hhh) $ git push Counting objects: 2, done. Delta compression using up to 4 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (2/2), 263 bytes | 263.00 KiB/s, done. Total 2 (delta 1), reused 0 (delta 0) remote: remote: 升級至騰訊雲開發者平臺得到更高代碼倉庫容量和帶寬,瞭解詳情:https://feedback.coding.net/topics/7257 To https://git.coding.net/jingxin_xinjing/test.git edc1447..db56b29 hhh -> hhh hxbjmy@hxbjmy-PC MINGW64 /f/test/test (hhh) $ git status On branch hhh Your branch is up to date with 'origin/hhh'. nothing to commit, working tree clean
git init 開發
git status 查看當前項目下全部文的狀態 rem
git add . 「.」點號表示對當前目錄下的全部文件/文件夾進行跟蹤
it
git commit -m 'test' 將文件提交到本地倉庫 , -m參數是對本次的提交進行描述
io
git remote add origin 'git@gitcafe.com:fnngj/pyse.git' 第一次提交項目,指定本地的項目跟遠程的哪一個倉庫創建鏈接
ast
git push -u origin master 將本地的項目提交到遠程倉庫
git pull origin master 將遠程的代碼拉取到本地
git clone git://gitcafe.com/fnngj/pyse.git 克隆代碼到本地