在github的html頁(yè)面url前面加上htmlpreview.github.io/?就能正诚辉担看到html頁(yè)面了。
Windows版的Git闻伶,從http://msysgit.github.io/ 下載哪自,然后按默認(rèn)選項(xiàng)安裝即可。
安裝完成后:
$ git config --global urser.nama "Your Name"
$ git config --global urser.email "email@example.com"
git 命令提示:
1洼怔、初始化git倉(cāng)庫(kù): $ git init
2、把文件添加到倉(cāng)庫(kù): $ git add file.name
3左驾、把文件提交到倉(cāng)庫(kù): $ git commit -m "文件注釋"
4镣隶、查看倉(cāng)庫(kù)當(dāng)前狀態(tài): $ git status
5、查看文件的不同: $ git diff
6诡右、查看歷史紀(jì)錄: $ git log $ git log --pretty=oneline
7安岂、回退版本:$ git reset --hard HEAD^
$ git reset --hard commit_id;
8帆吻、查看文件內(nèi)容 $ cat readme.txt
9域那、查看歷史命令 $ git reflog
10、查看工作區(qū)和版本庫(kù)里面最新版本的區(qū)別 $ git diff HEAD -- readme.txt
11猜煮、丟棄工作區(qū)的修改 $ git checkout -- readme.txt
12次员、恢復(fù)到最新版本 $ git checkout -- readme.txt
13、刪除文件 $ git rm test.txt
14王带、刪除文件夾 $ git rm a/b -r -f
15淑蔚、創(chuàng)建SSH Key $ ssh-keygen -t rsa -C "youremail@example.com"
16、本地倉(cāng)庫(kù)與github關(guān)聯(lián) $ git remote add origin git@github.com:githubname/object.git
17愕撰、解除本地倉(cāng)庫(kù)與github關(guān)聯(lián) $ git remote remove origin
18刹衫、可以把本地庫(kù)的所有內(nèi)容推送到遠(yuǎn)程庫(kù)上 $ git push -u origin master
19、克隆到本地庫(kù) $ git clone git@github.com:michaelliao/gitskills.git
20搞挣、創(chuàng)建+切換分支 $ git checkout -b branch
21带迟、查看分支 $ git branch
22、創(chuàng)建分支 $ git branch <name>
23囱桨、切換分支 $ git checkout <name>
24仓犬、合并某分支到當(dāng)前分支 $ git merge <name>
25、刪除分支 $ git branch -d <name>
26舍肠、強(qiáng)行刪除分支 $ git branch -D <name>
27搀继、查看分支合并圖 $ git log --graph
$ git log --graph --pretty=oneline --abbrev-commit
28、儲(chǔ)藏工作 $ git stash
29貌夕、查看工作現(xiàn)場(chǎng) $ git stash list
30律歼、恢復(fù)工作現(xiàn)場(chǎng) $ git stash apply stash內(nèi)容不刪除
$ git stash drop stash內(nèi)容刪除
31、查看遠(yuǎn)程庫(kù)的信息 $ git remote
32啡专、查看遠(yuǎn)程庫(kù)的詳細(xì)信息 $ git remote -v
33买猖、克隆遠(yuǎn)程庫(kù) $ git clone git@github.com:michaelliao/learngit.git
34梳杏、在本地創(chuàng)建和遠(yuǎn)程分支對(duì)應(yīng)的分支 $ git checkout -b branch-name origin/branch-name
35邓尤、建立本地分支和遠(yuǎn)程分支的關(guān)聯(lián) $ git branch --set-upstream branch-name origin/branch-name
36、抓取遠(yuǎn)程倉(cāng)庫(kù)信息 $ git pull
37鲸鹦、創(chuàng)建標(biāo)簽 $ git tag <name>
38、查看標(biāo)簽 $ git tag
39跷跪、刪除標(biāo)簽 $ git tag -d <name>
40馋嗜、推送標(biāo)簽到遠(yuǎn)程庫(kù) $ git push origin <tagname>
41、一次性推送全部本地標(biāo)簽 $ git push origin --tags
42吵瞻、刪除一個(gè)遠(yuǎn)程標(biāo)簽 $ git push origin :refs/tags/<tagname>
43葛菇、解決輸入每次輸入密碼的問(wèn)題 git config --global credential.helper store