Git - Diff 的小技巧,只比較特定檔案 取得連結 Facebook X Pinterest 以電子郵件傳送 其他應用程式 11月 27, 2014 一般來說,git-diff 會把所有追蹤中的檔案差異顯示出來,如果我們只要顯示 *.c 副檔名的檔案差異呢? $: git diff --name-only <branch> -- '*.c' 如此一來,就會限制輸出C檔案的差異!其中 --name-only 是為了突顯出有哪些檔案有差異,而查看差異內容。 取得連結 Facebook X Pinterest 以電子郵件傳送 其他應用程式 留言
Windows 上使用 Meld 進行 git-diff 5月 24, 2015 [Git Bash] git config --global difftool.meld git config --global difftool.meld.path "C:\Program Files (x86)\Meld\Meld.exe" 閱讀完整內容
用 Javascript 判斷使用者瀏覽網頁是用 Smartphone, Tablet or Desktop 1月 19, 2015 在網頁上貼上以下 <script type='text/javascript' src="//wurfl.io/wurfl.js"></script> 然後你可以使用 console.log(WURFL); 從瀏覽器的除錯Console印出現在瀏覽的裝置資訊 要判斷瀏覽器是否為移動裝置可以直接使用 if(WURFL.is_mobile){ //dostuff(); } 只不過這將會把 Tablet, Smartphone 都算在 mobile 裡面 如果要區分是否的更詳細可以使用以下的判斷 if(WURFL.form_factor == "Tablet"){ //dostuff(); } 而 form_factor 包含了以下幾種 Desktop App Tablet Smartphone Feature Phone Smart-TV Robot Other non-Mobile Other Mobile 閱讀完整內容
Git - 同時 push 到多個 remote 12月 05, 2014 倘若 Repository 中有多個 Remote 而且希望一次 push 操作同時丟到多個 Remote 上,可以輸入以下指令來編輯 config : $: git config -e 先前你如果已經設定好偏好的編輯器,則會使用設定好的編輯器進行編輯 。在檔案下方建立一個新的 Entry ,例如: [remote "all"] url=ssh://user@server/repos/g0.git url=ssh://user@server/repos/g1.git 然後 push 改指定 all 這個 Remote 名稱,就會發現同時丟往這兩個位置了! 閱讀完整內容
留言
張貼留言