Category Archives: Git

Can you arc diff against a particular git branch?

Questions: I’m pretty new to both Arcanist and git. I’d like to be able to create an arc diff (Phabricator Differential instance using Arcanist) against a git branch that I’m currently checked-out/working in (and I have one local un-pushed commit) rather than the master. To me the arc docs are unclear on this. Is it… Read More »

Set UTF-8 display for Git GUI differences window

Questions: I can’t remember how I made Git GUI to display UTF-8 encoded differences correctly. Also I can’t find the guide in search engines. Now I need to do this at new workplace. Could you write down instructions? OS: Windows 7 Answers: # Global setting for all you repositories > git config –global gui.encoding utf-8… Read More »

How does the newly found sha1 collision affect git?

Questions: Recently a team of researchers generated two files with the same sha1-hash (https://shattered.it/). Since git uses this hash for its internal storage, how far does this kind of attack influence git? Answers: The short (but unsatisfying) answer is that the example files are not a problem for Git—but two other (carefully calculated) files could… Read More »

Setting up git server with web interface?

Questions: As our company would never let a third party like github anywhere near our source code, is anyone aware of any software or setup guides or blogs on how to setup a scm server like github, ie it would support Creation of repostories using a web interface Limiting/managing user access to individual repositories Browsing… Read More »

git revert commit/push but keep changes

Questions: It goes like this: I have files A and B that I modified I’m only suppose to commit and push A, but accidentally committed both and pushed both A and B I did a “git push old-id:master” so on github it shows “Master is now old-id” where old-id is the last commit before me,… Read More »

Git ignore file for Xcode 4 projects

Questions: Which files are better to ignore in git for an Xcode 4(.3.2)? This older question addresses the same issue but I find my structure to be different so I assume it’s about an older version of Xcode. Answers: Here are git ignore files for basicly every language including Xcode : Github – git ignore… Read More »

Connecting to GitLab repositories on Android Studio

Questions: I’m trying to connect to a GitLab repository using the I/O preview of Android Studio. Does anyone know how to do this/if it is possible yet? Answers: To clone a repo Open a new project in Android Studio. Click VCS -> Checkout from version control -> Git then enter the URL of the repo… Read More »

Also use comma as a word separator in diff

Questions: How can I add , as a word separator for git diff –word-diff? For instance I would like the diff to recognize that function(A,B,C) -> function(A, B, C) only has added the spaces instead of replacing the whole line. Answers: Use –word-diff-regex: –word-diff-regex=<regex> Use <regex> to decide what a word is, instead of considering… Read More »

Category: Git

Can I use “git checkout –” on two files?

Questions: Is it possible to use git checkout — on multiple files in order to discard the changes? If so how would I specify multiple files. Thanks. Answers: Run the command multiple times git checkout — path/to/file/one git checkout — path/to/file/two Or specify the multiple files in the same line: git checkout — path/to/file/one path/to/file/two… Read More »