From 9d208e2b67cd21ee93b6bdd4179550f15426da8a Mon Sep 17 00:00:00 2001 From: eleonore12345 Date: Mon, 22 Jul 2024 11:07:59 +0200 Subject: [PATCH] help written --- git_update.sh | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/git_update.sh b/git_update.sh index 45d9a78..c60834c 100755 --- a/git_update.sh +++ b/git_update.sh @@ -1,12 +1,32 @@ #!/bin/bash summary="$0 [options] " - ref=main dst='.' nonempty_target=false use_home=false be_aggressive=false +Help(){ + echo " +NAME + git_update.sh +SYNOPSIS + git_update.sh [-h] [-r ref] [-d dest] [-H] [-N] [-a] repository +OPTIONS + -h prints the help. + -r specifies the reference to the commit to be synchronized. It can be a tag or a branch. By default, it is the last commit of branch main. + -d specifies the destination of the clone or update. If non-empty, -N must be specified. + -H + -N indicates that the destination is non-empty. The files that do not conflict and if it is an update, are not committed, will be kept. + -a specifies that the aggressive option of git clean must be used. git clean is called wen -N is not specified. + If the repository to be cloned is local, and its path is passed as a relative path, the path should start from the destination. + To avoid mistakes, absolute paths are advised. + +DESCRIPTION + This script will replace the destination with the wanted commit of a git repository. The history is not preserved but tags are. + The git commands have been chosen so as to minimize the memory and bandwidth usages." +} + while getopts ":hr:d:NHa" option; do case $option in h) # display Help