help written
This commit is contained in:
parent
f16c64204e
commit
9d208e2b67
@ -1,12 +1,32 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
summary="$0 [options] <repo>"
|
summary="$0 [options] <repo>"
|
||||||
|
|
||||||
ref=main
|
ref=main
|
||||||
dst='.'
|
dst='.'
|
||||||
nonempty_target=false
|
nonempty_target=false
|
||||||
use_home=false
|
use_home=false
|
||||||
be_aggressive=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
|
while getopts ":hr:d:NHa" option; do
|
||||||
case $option in
|
case $option in
|
||||||
h) # display Help
|
h) # display Help
|
||||||
|
Loading…
Reference in New Issue
Block a user