图解 Git 工作原理
大数据文摘
共 3446字,需浏览 7分钟
·
2021-05-05 08:23
基本用法
基本用法
![](https://filescdn.proginn.com/9eee69db27b83b4be7e0924059edecdf/3259202fd14ded6ed2d561126336bfcd.webp)
git add files把当前文件放入暂存区域。 git commit给暂存区域生成快照并提交。 git reset – files用来撤销最后一次git add files,你也可以用git reset撤销所有暂存区域文件。 git checkout – files把文件从暂存区域复制到工作目录,用来丢弃本地修改。
![](https://filescdn.proginn.com/7d73e61fbff7de08c7a23fc8650c61f4/e5e797f82a8b64e698d7e3395958ad11.webp)
git commit -a相当于运行git add把所有当前目录下的文件加入暂存区域再运行。 git commit files进行一次包含最后一次提交加上工作目录中文件快照的提交。并且文件被添加到暂存区域。 git checkout HEAD – files回滚到复制最后一次提交。
约定
约定
![](https://filescdn.proginn.com/5e07524bd907a603a13adc0fa6d55a34/ac89bfc8ab8da4a89d80ac970dfb3a54.webp)
命令详解
命令详解
![](https://filescdn.proginn.com/7bd7c87400ba747094c9f607fc5dbfe8/400ca9777a55a0dd906b404f95310b16.webp)
![](https://filescdn.proginn.com/9a4a9d531e058ee54ebe8d2821adf4e5/c792eaebf4796b99812f44fa5093e829.webp)
![](https://filescdn.proginn.com/619b42ab5fddd41690c0bd8838827b0a/acea454bf94b6a281b6826229e8fae41.webp)
![](https://filescdn.proginn.com/6017190cfc43c38146aa0a0b39df6fe7/eb376d7a1c36b0d9f0315aa001bf9284.webp)
![](https://filescdn.proginn.com/861319ffb83587281982f40900210d25/234ef4705aad47435a52e5653540220a.webp)
![](https://filescdn.proginn.com/29d91da44e1525f1083b12fe7d5317f0/2bc04de9ebabb04253d378248e0ce479.webp)
![](https://filescdn.proginn.com/457b4b0f6742e3b0e0f353e3e9ba9dc5/1fdc3ae06aff7e8b2cb36eca0f6c4352.webp)
![](https://filescdn.proginn.com/99a37f37570e8820e9ad33176e5715b3/b9e16a41b03cdb5a6bb2d07ba1f600d2.webp)
![](https://filescdn.proginn.com/a347c68b5dd1a6f50a8b1ef65f9a52a7/e4058d044d900b0cda5c932f613b2580.webp)
![](https://filescdn.proginn.com/b0fc6a077970863aa218fa6ca8fc6658/17ffd5f17d7b58269e75d0b36efe7296.webp)
![](https://filescdn.proginn.com/597d04f28ff752a8005ffd4744085ec5/2ab70664f19c810e27cf1c17d716ee7d.webp)
![](https://filescdn.proginn.com/ec6716afadcb137eb448613f20ba3ab9/dcce4e6f242d2c18b4efb4df98288753.webp)
![](https://filescdn.proginn.com/12709f5235e920d7dbe86c09e1ec9e82/c71a5c7649c95c7e1795f29b6d49c5d9.webp)
![](https://filescdn.proginn.com/590dd048f7195cc16cdf679520f3b682/bc07aa3baa7f319330e6a17e5944a267.webp)
![](https://filescdn.proginn.com/8f7a8bca9bf342530048fef974fa071d/def3a3304adf9c92ae5afb1d81885755.webp)
![](https://filescdn.proginn.com/35186bd36b3dc7971fd3ad8d00591af8/542850e8d41d5dbe89229cdae9cfce89.webp)
![](https://filescdn.proginn.com/77a45d81a74131344385c5c129cca2cf/5bd019ef1346aa4583b08972ec647f91.webp)
![](https://filescdn.proginn.com/9dc5e471a562566d6afd97f7802119cf/346690d662de000273e92fec36294694.webp)
技术说明
技术说明
http://marklodato.github.io/visual-git-guide/index-zh-cn.html#merge
http://marklodato.github.io/visual-git-guide/index-zh-cn.html#rebase
http://marklodato.github.io/visual-git-guide/index-zh-cn.html#detached
http://en.wikipedia.org/wiki/Three-way_merge
http://www.kernel.org/pub/software/scm/git/docs/git-rebase.html#_interactive_mode
![](https://filescdn.proginn.com/a217a8bbca93153c5b845ba200d2b94b/d4a8ad5b3bcf477170758b0aeda47bf1.webp)
评论