Show Menu
Cheatography

Gitutils

Gitutils is a tool to facilitate server­-side operations when developing software that uses git reposi­tories. It allows users to create forks and merge requests directly from the command line interface.

FORK : Fork existing reposi­tories into your own personal space. Doing a fork is strongly recomm­ended to freely experiment your changes and/or develo­pment in a safe working space without affecting the original project.

MERGE : Merge existing reposi­tories from your personal space into the original reposi­tory. Merge has the purpose of joining different reposi­tories to incorp­orate changes into reposi­tory.
for the full docume­nta­tion: gitut­ils.re­adt­hed­ocs.io­/en­/la­test/

Instal­lation

Use conda to install the latest stable version of Gitutils:

conda install -c paulsc­her­rer­ins­titute gitutils
Gitutils is compatible with Python 3.5+.

Fork examples

Fork and clone: gitutils fork <gr­oup­_na­me>­/<r­epo­_na­me>
Fork and not clone: gitutils fork <gr­oup­_na­me>­/<r­epo­_na­me> -n
Fork, clean and clone: gitutils fork <gr­oup­_na­me>­/<r­epo­_na­me> -c
Fork, clean and not clone: gitutils fork <gr­oup­_na­me>­/<r­epo­_na­me> -c -n

Merge examples

merge (default title and descri­ption): gitutils merge
merge (from project's direct­ory): gitutils merge -t <ti­tle> -d <de­scr­ipt­ion­>
merge: gitutils merge -p <gr­oup­_na­me>­/<r­epo­_na­me> -t <ti­tle> -d <de­scr­ipt­ion­>
if -p is not indicated, gitutils fetches project from the .git/­config file.
 

Gitutils arguments

-h (help):
Shows the help message and exit
-e (endpo­int):
Allows the user to change the endpoint of the git server. Default: https:­//g­it.p­si.ch
Usage:
gitutils -h
gitutils -e https:­//m­y-g­it-­ser­ver.ch <fo­rk_­or_­mer­ge>

Fork arguments

-n (no clone):
Indicates that the forked project will not be cloned after forking. A fork will be created on the server­-side and no clone nor upstream will be generated on the local git server.
-c (clean):
Indicates to delete any existing fork project under your personal group. This might be necessary to fork and clone into a clean copy of the original reposi­tory. The desired forked project must not be a pre-ex­isting forked project under your personal projects.
To see the help message for fork: gitutils fork -h

Merge arguments

-p (project):
Indicates the project to be forked.
-t (title):
The title of the merge request that is going to be created.
-d (descr­ipt­ion):
The descri­ption of the merge request that is going to be created.
To see the merge help message: gitutils merge -h
   

Help Us Go Positive!

We offset our carbon usage with Ecologi. Click the link below to help us!

We offset our carbon footprint via Ecologi
 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Git Cheat Sheet
          Bash Dev Cheat Sheet