Using Git with Domino Designer - the hardcore way

This is a first part of posts on version control with Git for Notes developers. I'm writing it as an addendum to my BLUG 2012 session "Version control for Notes developers".

Version control for Domino Designer projects - using command line Git (aka the HARDCORE way)

Designer 8.5.3 has built-in capability to link NSF/NTF files with so called on-disk projects that can be used by version control systems. That alone is not enough to successfully use version control systems directly from Designer. But it is enough to use them from the command line! From now on I'm assuming that you've created on-disk project out of one of your NSF/NTF files and this on-disk project is called "git_test".

EDIT: I was wrong, you should install EGit plugin to let DDE know that on-disc project is under version control and that it should not sync .git folder to NSF and back to ODP, more about this here.

1. Install Git for Windows

You can download Git for Windows here. Simply run downloaded file and leave all settings in default values. Of course you can adjust these settings if you know what you're doing :) This should add Git Bash icon to your desktop. Double click it to open the Bash prompt.

2. Start using it

On-disk project is just folder with files and sub-folders within your workspace folder. Start Git Bash, go to workspace folder under your Notes/data (i.e. cd "C:\Program Files\ibm\lotus\notes\data\workspace"), locate the folder with the name of the on disk project (in our case type cd git_test) and type git init, followed by git add -A and git commit -a -m 'initial import'". After execution of these commands your on-disk project is "saved" to the Git repository located in ".git" subfolder.
git init creates empty repository,
git add -A adds all the files in current folder (and all subfolders) to git's index and
git commit -a actually saves current state of all those files to the repository (Git tracks changes only in files that has been added to its index).
After you make some changes to original NTF/NSF, switch back to command line prompt and simply type git add -A followed by git commit -a -m "here put your comment". If you omit -m parameter, Git will open text editor for you to enter your comment there.
Every time you create a new design element you have to add it to Git's index by typing git add name_of_file.
More advanced usage is to select what changed files are going to be commited, not commiting them all. This is convenient in case you've made some changes to several design elements but you want to have those changes saved as two separate steps (commits). For example if you've fixed two bugs or added two new features (or more, of course).
Instead of git commit -a you can use git commit name_of_file1 name_of_file2 ... -m "here put your commit description"

To find out what files has been modified and/or added you can use command git status

In the next part I'll show you how to install and use git-flow and how to tweak your command prompt to show you some valuable information about the state of your on-disk project's repository.
Stay tuned...

Tags: 

Comments

Source Control

Great info but trying to use the command line is a real hurdle I think.

If you don't want to go all "hard core command line". I've done two videos on using source control in Domino Designer.
http://notesin9.com/index.php/2012/01/29/notesin9-041-xpages-designer-so...
http://notesin9.com/index.php/2012/02/13/notesin9-044-using-source-contr...

Now this is using Mercurial and not Git, but the concepts are very similar. The second show talks about bitbucket.org which is a nice easy place to host your project.

CLI

If you think using a command line is a "real hurdle" you have bigger problems than choosing which source control tool to use.

(Oh and this kind of source control is useless for anything other than SSJS and XPages BTW....)

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
5 + 6 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.