git 在windows下的應用(一) - 本地倉庫代碼管理

來源:互聯網
上載者:User

標籤:軟體研發   研發管理   

訪問https://gitforwindows.org/? 下載一個安裝包,一路next下去

git config --global user.name "Pcdog" git config --global user.email "[email protected]"

cd d:

mkdir git

建立一個目錄

初始化

git init

.git目錄中會產生database

我把當前日期產生1.txt 並且提交到git

date>1.txt

git 1.txt

scan 下發現新的檔案

加個注釋然後提交

倉庫中檔案時間是17:56

檔案中檔案時間是17:56

提交曆史

把最新的17:56的提交記錄恢複

檔案恢複到上一次提交的狀態17:54

使用git add . 可以添加全部檔案

或者加入目錄

看狀態

git status

可以看哪一些檔案改動過了

git diff

只看某一個檔案

git diff 1.txt

git checkout 1.txt 快速復原

git log 看記錄,不過有git ui更加方便點

git log -1 -p

查看最近一次更改了些什麼

增加分支

git branch version1.0

切換分支

git checkout version1.0

代碼合并

git checkout master git merge version1.0

刪除分支

git branch -D version1.0

本地倉庫基本上都玩過了

git 在windows下的應用(一) - 本地倉庫代碼管理

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.