現在一直使用Git來管理代碼,對於有強迫症的我來說,依舊選擇了命令行,下麵這段話可以更好的解釋我為什麼喜歡使用終端敲命令。 There are a lot of different ways to use Git. There are the original command line tools, ...
現在一直使用Git來管理代碼,對於有強迫症的我來說,依舊選擇了命令行,下麵這段話可以更好的解釋我為什麼喜歡使用終端敲命令。
There are a lot of different ways to use Git. There are the original command line tools, and there are many graphical user interfaces of varying capabilities. For this book, we will be using Git on the command line. For one, the command line is the only place you can run all Git commands – most of the GUIs only implement some subset of Git functionality for simplicity. If you know how to run the command line version, you can probably also figure out how to run the GUI version, while the opposite is not necessarily true. Also, while your choice of graphical client is a matter of personal taste, all users will have the command-line tools installed and available.
但是發現在Terminal查看文件修改的內容並不是很方便,後來就結合Xcode本身已經集成Git相關功能的界面,來輕鬆的查看代碼的修改信息。下麵舉幾個例子來和大家一塊學習。
用法一
Source Control --> History... --> 歷史修改信息(界面見下圖) --> 選擇想要查看的某次修改(Show modified files) --> 被修改的代碼一目瞭然
用法二
看到某塊代碼突然想看修改記錄和代碼修改人(好比一段很牛掰"垃圾"的代碼,想知道誰寫的) 右鍵 --> Show Blame for Line --> Open in Blame / Open in Comparison --> 效果如下
用法三
View --> Version Editor --> Show Log View ///等其他,下圖所示