Git命令行和Xcode結合使用(我來告訴你這行代碼誰寫的)



現在一直使用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 ///等其他,下圖所示


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM