Skip to main content

Posts

Showing posts with the label git

GitX and Finder in MacOs

GitX is a cool tool to visualize your git branches. It automatically assumes all files ending in .git files are git applications. When you browse files in Finder, anything ending in .git is now not a folder anymore, and clicking on it will launch GitX. Very annoying. I assumed I could just right click the file and set Open with to finder, but you can only change it to other applications, you can't tell your Mac that foo.git is a folder, not a git application. Instead, I edited the file /Applications/GitX.app/Contents/Info.plist (sudo!). Remove the following line inside CFBundleTypeExtensions <string>git</string> ... <key>CFBundleTypeExtensions</key>       <array>           <string>git</string>           <string></string>       </array> ... And then run /System/Library/Frameworks/CoreServices.fr...

git merge --squash

Start out on branch master, then work on an experimental branch $ git checkout -b experimental Do a series of commits etc. If you decide that the experimental features should now be part of master, do the following: $ git checkout master $ git merge --squash experimental $ git commit -a The commit message automatically has a list of all commits in experimental.

git status

git status --untracked-files=no or git config alias.stat "status --untracked-files=no" and then git stat I'm trying to trace a bug in some big subversion repository, and decided to put the relevant files under git control. Let's see how that works.

git-svn

You can make sure these changes were committed to the svn repository, by doing a svn up in a regular svn clone of the repo. To fetch changes from the svn repo, instead of svn up , do

Setting up remote git repository

On your remote machine, create a new directory and start a new git repository. On your local machine, or wherever you have the files, start a git repository, add the files you need, and commit them. Now you have your files under revision control, but only locally, which is bad if your hard drive breaks or if you work from more than one machine. So add the repository on the remote machine as another remote directory and push to it. To get the files on another machine, do

Git pushing to multiple repositories

If for some reason you have to push to multiple repositories, add an alias to your .git/config (obviously you don't want this in your ~/.gitconfig): The exclamation mark runs the alias as a command, without an exclamation mark, it's assumed that you run a git command. results in a change in your ~/.gitconfig which you can delete with or delete all aliases.