1、概述
git是開源的分布式版本控制工具,作者是寫Linux的Linus Torvalds。初衷是為了管理Linux內核。
git和GitHub的關系事后再講。
2、安裝git
2.1 下載
下載地址:https://gitforwindows.org/ 或 http://git-for-windows.github.com
下載好是這個樣子
點擊安裝一路點next就好了
3、創建代碼倉庫
3.1打開Git Bash,並告訴它我是誰
git config --global user.email "you@example.com" git config --global user.name "Your Name"
3.2創建代碼倉庫
選中項目目錄,這里我以我自己的D:\codePy\test項目為例
就完成了,項目目錄下出現了隱藏目錄“.git”
4、提交本地代碼
4.1 插入全部文件
git add .
4.2 提交
git commit -m " first commit"
一定要用 - m 來添加描述信息