Git 堪稱版本控制瑞士軍刀。這個可靠、多才多藝、用途多樣的校 訂工具異常靈活,以致不易掌握,更別說精通了。
正如Arthur C. Clarke所說,足夠先進的技術與魔法無二。這是學習Git的好辦法:新手 不妨忽略Git的內部機理,只當小把戲玩,藉助Git其奇妙的能力,逗逗朋友,氣氣敵人。
爲了不陷入細節,我們對特定功能提供大面上的講解。在反覆應用之後,慢慢地你會理 解每個小技巧如何工作,以及如何組合這些技巧以滿足你的需求。
Git命令: http://gitref.org/creating/
Github的一個10分鐘在線小教程: try.github.com
Git高階, 一些深入講解: http://www-cs-students.stanford.edu/~blynn/gitmagic/intl/zh_cn/
Git for computer scientists: http://eagain.net/articles/git-for-computer-scientists/
Git最新版本地址: https://launchpad.net/~git-core
Git命令:
1.顯示有幾個remote: $ git remote show
2.顯示具體一個remote 信息 : $ git remote show master
3. 如果git版本1.7.9以及以後,連接github用https, 每次會要求輸入密碼,這個指令可以讓你15分鐘以內不需要輸入密碼:
$ git config --global credential.helper cache
或者讓時間更長一點:
$ git config credential.helper 'cache
--timeout=3600'
4.
如果git版本1.7.9以前,
With versions of git before 1.7.9, this more secure option is
not available, and you'll need to change the URL that your
origin
remote uses to include the password in this
fashion:
https://you:[email protected]/you/example.git
... in other words with :yourpassword
after the
username and before the @
. You can set a new URL for
your origin
remote with:
git config remote.origin.url https://you:[email protected]/you/example.git
Make sure that you use https
and you should be
aware that if you do this, your github password will be stored in
plaintext in your .git
directory, which is obviously
undesirable.