如何從我的Mac OSX上的github獲得這些更改?Github得到承諾的變化
https://github.com/ettore/three20/commit/63d03a12a6aac60453c94c12d714965aaca810ae
如何從我的Mac OSX上的github獲得這些更改?Github得到承諾的變化
https://github.com/ettore/three20/commit/63d03a12a6aac60453c94c12d714965aaca810ae
抓取ettore/three20
庫的在精確狀態的副本git
:
# Create a new (empty) repo
git clone https://github.com/ettore/three20.git
# Enter repo
cd three20
# Checkout the commit
git checkout 63d03a12a6aac60453c94c12d714965aaca810ae
你可以通過THIS API這次提交從GitHub的變化:
GET /repos/:user/:repo/git/commits/:sha
一個例子你給的那個:
curl -i https://api.github.com/repos/ettore/three20/commits/63d03a12a6aac60453c94c12d714965aaca810ae > commit_changes
然後您可以查看生成的commit_changes
文件中的總數據。這個文件的格式是JSON,你會發現在"patch"
的變化,比如:
「補丁」:「@@ -38,6 +38,12 @@ \ n靜態常量NSInteger的kLoadMaxRetries = 2; \ n接口TTRequestLoader()\ n + - (void)連接:(NSURLConnection *)連接didReceiveResponse:(NSHTTPURLResponse *)響應; \ n + - (void)連接:(NSURLConnection *)連接didReceiveData :(NSData *)data; \ n + - (void)connectionDidFinishLoading:(NSURLConnection )connection; \ n + @ end \ n + \ n /////////////////////// ////////////////////////////////////////////////// ////////////////////////// \ // ////////////////////// ////////////////////////////////////////////////// /////////////////////////// \ // ///////////////////// ////////////////////////////////////////////////// //////////////////////////// \ n @@ -100,7 +106,8 @@ - (void)deliverDataResponse :(NSURL)URL {\ n //嚴格來說,要真正符合需要解釋%xx十六進制編碼實體。\ n // [NSString dataUsingEncoding]不能正確執行。 ...........(省略)
您可以發現很難閱讀,但如果可以的話,您可以使用Regular Expression
更好地進行格式化。顯然,在+
/-
的開始處和\n
的末尾添加/刪除的行。
您可以在vim
運行此命令(如果使用):
:%s/\\n/^M/g
這個替換每\n
到一個真正的換行符(^M
由Ctrl+v
進入 - >Enter
)。現在看起來不錯,但我認爲你可以做得更好。 ;)
注意:如果您的更改包含一些二進制文件(如icon.png),您將獲得大量無用的數據。
非常感謝!這工作 – Chris 2012-01-10 20:53:42
@Chris歡迎:) – Kjuly 2012-01-11 03:28:49