Now that you know what Collate is about, you can follow this guide to learn how to use Collate effectively.
-
Install JDK 8u40 or later: Earlier Java version will not work. You can get it [here] (http://www.oracle.com/technetwork/java/javase/downloads/index.html).
-
Download Collate: You can then download
Collate-GUI.jarfrom the latest release here: https://github.com/collate/collate/releases -
Mark your code with
@@authortags: Here are some examples.For
.fxmlfiles, ensure that thexmltag comes before your author tags -
Launch Collate Simply double-click on the
Collate-GUI.jarfile to start Collate. You will be greeted with a simple interface that has a command bar. This command bar is where you enter short commands to tell Collate what to do.

-
Ask Collate to collate your code. As shown in the above animation, you can type
collate from <FOLDER>to collate all files within<FOLDER>including subfolders. -
View reports: The reports can be found in a folder called
collated. You'll find one.mdfor each author, containing the code written by that author. Here is an example. -
Try more commands:
view <AUTHOR'S NAME>- See author's individual statistics e.g.view Sebastiansummary- See the default statistics summary tableexit- Exit Collate using the command bar
To learn more details of Collate features, refer to the 'Feature Details' section below.
Using the @@author tag, you can specify the lines of code that you have written.
Lines between your author tag and the next author tag will be marked as yours.
Your name can include letters and numbers.
Tip: Make sure to use the same name so that the code you wrote will be saved correctly in a single file.
You can include any type of file, as long as the @@author tag is present.
You can also use an empty author tag (i.e. an author tag without an author name) to mark end of your code segment. Empty author tags are helpful to avoid claiming code written by another author who has yet to enter his/her author tags.
To collate files in a folder and all its sub folders, use this command.
collate from <FOLDER>
Tip: If your folder includes whitespaces, you will need to surround the folder with double inverted commas.
Examples:
collate from srccollate from .collate from C:/myProject/component1/srccollate from "C:/source files"
If you would like to collate files only from the specified folder, and not files from sub folders,
you can add the only option.
collate from <FOLDER> only or collate only from <FOLDER>
Tip: option order of the
collatecommand is flexible. You need not worry about the position of these options, just remember to start each command with thecollatekeyword.
Examples:
collate from C:/myProject/component1/src onlycollate only from C:/myProject/component1/src
Collate scans the folder you specified for all types of file. What if you want to collate only java files?
Well, you can use the include option.
collate from <FOLDER> include java
You can include multiple filetypes by separating them with commas.
collate from <FOLDER> include java, css, fxml
Examples:
collate from C:/src javacollate from C:/src java,md,css,txt
Viewing an author's contribution statistics can be done by entering the following command.
view <AUTHOR's NAME>
Tip: To make using Collate easier, the author's name is not case-sensitive.
This view allows you to see the proportion and number of lines of code the author wrote for files he/she contributed to.
The summary view is the default screen that shows you the contributions of all authors. To access it, simply enter the following.
summary
Simply close the window or type the following command in the command bar.
exit
Collate also provide a version that uses a Text UI instead of a GUI.
To use it, first download the Collate-TUI.jar from the same location.
Then, open a command window in the same folder as Collate-TUI.jar and enter java -jar Collate-TUI.jar.
You can then enter commands described earlier this this document within the command window.
Here are some examples:
| Command | Description |
|---|---|
collate from <FOLDER> |
Collate all files within <FOLDER> including subfolders |
collate from <FOLDER> only |
Collate files in <FOLDER> only |
collate from <FOLDER> include <FILETYPE1>, <FILETYPE2> |
Collate <FILETYPE1> and <FILETYPE2> files in <FOLDER> and its subfolders |
collate from <FOLDER> only include <FILETYPE1> |
Collate <FILETYPE1> files in <FOLDER> only |
view <AUTHOR'S NAME> |
See author's individual statistics |
summary |
See default statistics summary table |
exit |
Exit Collate |






