Git & Titanium Tips

Up until recently most of my SCM experience has been around SVN and the Microsoft tooling. After jumping into the Titanium eco system I quickly found git was the best way to manage these projects.

Below are two tips I found helpful in reducing my commit noise and better managing my repos.

I also recommend checking out a great wiki article on Spheriki called "Git for the lazy". It is a fast way to get started.

Ignore Build Directories

By adding a .gitignore file into the root of your /[project]/build directory you can avoid having git track the files that Titanium auto generates.  You should be versioning your apk and .app files that you send to your testers, but I found that I do so many compiles it is best to have a separate process for this.

Creating your .gitignore file:

  1. Open terminal and go to your project’s build directory. It should be something like [Your Workspace]/[Your Project Name]/build
  2. In terminal type nano .gitignore
  3. The nano edit will open in your terminal session
  4. Add the tmp, android/, and iphone/ entries you see below
  5. Press Control + X to exit
  6. Press Y to save your changes
  7. Press return to finish


view raw .gitignore This Gist brought to you by GitHub.

Tell git to globally ignore .DS_Store files

Another pet peeve of mine is around .DS_Store files. To globally ignore them just open a terminal window and type the below.

git config --global core.excludesfile ~/.gitignore

echo .DS_Store >> ~/.gitignore


Post a Comment