比较和整合工具

要了解在项目中都发生了什么,你就需要检查发生的改动。由于改动过的文件会被表示为 “diff”,所以关键就是在于更好地理解这些改动差异。

尽管在命令行界面中可以非常简单地输出这些差异信息,但是要读懂这些信息还是很有难度的。

$ git diff
diff --git a/css/about.css b/css/about.css
index e69de29..4b5800f 100644
--- a/css/about.css
+++ b/css/about.css
@@ -0,0 +1,2 @@
+h1 {
+  line-height:30px; }
\ No newline at end of file
diff --git a/css/general.css b/css/general.css
index a3b8935..d472b7f 100644
--- a/css/general.css
+++ b/css/general.css
@@ -21,7 +21,8 @@ body {

 h1, h2, h3, h4, h5 {
   color:#ffd84c;
-  font-family: "Trebuchet MS", "Trebuchet"; }
+  font-family: "Trebuchet MS", "Trebuchet";
+  margin-bottom:0px; }

 p {
   margin-bottom:6px;}
diff --git a/error.html b/error.html
deleted file mode 100644
index 78alc33..0000000
--- a/error.html
+++ /dev/null
@@ -1,43 +0,0 @@
- <html>
- 
-   <head>
-     <title>Tower :: Imprint</title>
-     <link rel="shortcut icon" href="img/favicon.ico" />
-     <link type="text/css" href="css/general.css" />
-   </head>
-

比较工具仅仅致力于一个单一的工作,那就是帮助你来更容易地理解这些差异。它会使用不同的颜色,特殊的格式,甚至是不同的布局(并排,组合单个列等等)来展现出不同文件中差异:

其中一些工具甚至还可以帮助你解决合并冲突。特别是在这种情况下,你很快就能体会到,它可以非常有效地帮助降低操作的复杂性并避免错误的产生。

今天,我们可以找到很多强大的比较工具。下面这个列表就为你列出了一些:

Mac OS X

Windows

Get our popular Git Cheat Sheet for free!

About Us

As the makers of Tower, the best Git client for Mac and Windows, we help over 100,000 users in companies like Apple, Google, Amazon, Twitter, and Ebay get the most out of Git.

Just like with Tower, our mission with this platform is to help people become better professionals.

That's why we provide our guides, videos, and cheat sheets (about version control with Git and lots of other topics) for free.