GitPM CLI Usage

As GitPM is a commandline application (learn about the library here), you may want to open your terminal!

After installing, just type gitpm. You may want to learn about how GitPM manages projects before.

gitpm create

To create new projects, run gitpm create [name].

An id will automatically be assigned (starting at 0000 counting in hexadecimal). If you want to change the id, append --id [id] or -i [id].

If you want to create a bare repository, append -b.

gitpm remove

To remove a project, run gitpm remove [name], or just delete the folder containing it.

gitpm clone

To clone a project, run gitpm clone [project]. This will create a clone of your project in a folder called [project]-clone. If you want to clone the project to a specific directory, just run gitpm clone [project] [destination].

gitpm list

To list all projects in the current directory, run gitpm list.

To filter them by maintainance status, append --status [status] or -s [status]. Choose from new, maintained, discontinued, completed or undefined. Appending -i to this will invert the status filter.

To search for a name of a project, you can append -f [string], which will match projects if their name contains [string]

You can also select to only list bare repositories by appending --type bare or only regular repos by appending --type repo.

Limit the amount of entries in the output table by appending -n [amount].

Append -r to find projects recursively.

GitPM will print a colorful table like this:

GitPM found these repositories:

----    project-1                       maintained    40484206    
----    project-2                       new           b4306321    
----    project-3                       discontinued  a5c83421    
----    project-4                       completed     fcbf8f0b


And these bare repositories:

----    project-bare                    new           fcbf0f0c

gitpm details

To view the details of a project, run gitpm [project-name] or gitpm [project-selector] details. Possible selectors are the project's path, its name and its id.

gitpm stat

Similar to gitpm details but displays stats for all repositories in a directory. Run gitpm stat.

gitpm set

GitPM set is used to modify project metadata. Run gitpm [project-name] set [variable] [value] to set a metadata variable to a new value.

variable purpose value
id The project's id. A hexadecimal string like 0000.
name The project's name. A string with len(string) <= 32.
status The project's maintainance status. One of {'new', 'maintained', 'discontinued', 'completed', 'undefined'}.
description The project description. A string of any length.
tags Social tags / categories. A string of comma-separated values like tag1, tag2, tag3.

gitpm git

GitPM extends git's functionality, it doesn't aim to replace git in any way.

Running gitpm [project-name] git is the same as running git in the project's directory.

Common git commands are known by GitPM, so that you can simply run gitpm [project-name] [command] (instead of gitpm [project-name] git [command]):

use case command
View the staging status. gitpm [project-name] status
Commit changes. gitpm [project-name] commit
List all remotes. gitpm [project-name] remote -v
List all branches. gitpm [project-name] branch
List all commits on [branch]. gitpm [project-name] rev-list [branch]
Fetch from remote. gitpm [project-name] fetch

Check out the git docs for more useful git commands.

gitpm update

Update two projects metadata with one another by running gitpm [project1] update [project2]. Append the -v option for verbose output.

After entering the command, you will see the difference in metadata / commits and will be asked which exact metadata you prefer and weather you want to push from one project to another project (both have to have a common commit-history though).

gitpm sync

To update all projects in a directory with all projects in another directory, run gitpm sync [other dir] in your project workspace directory. It is crucially important that you have unique IDs assigned to your projects, as they are the only thing gitpm sync looks for.

Adding the -v flag will give the same verbose output as gitpm update, appending -s will also sync projects than only exist in one place by asking you if you want to copy them (and copying then if you say so).

gitpm loop

Enter the GitPM shell by running gitpm loop.

You can execute GitPM commands without typing gitpm before them, like this:

Example usage in terminal

To exit the loop, type exit, quit, q or just press CtrlC.

If you only want to work on a single project in the loop, type checkout [id]. Now, you may type valid project commands like fetch, rename [name] or tag.