readme principal plus joli v3

This commit is contained in:
eleonore12345 2024-07-25 11:17:35 +02:00
parent 968d9d32f5
commit f7117b937a

View File

@ -1,7 +1,7 @@
# Overview # Overview
git_update.sh is a bash script performing a punctual synchronization of a git repository. It can either be a new clone or an update. git_update.sh is a bash script performing a punctual synchronization of a git repository. It can either be a new clone or an update.
*CAREFUL*: git_update.sh is not working-directory safe and can delete your work. **CAREFUL**: git_update.sh is not working-directory safe and can delete your work.
``` ```
git_update.sh -d ~/website -r V3 $REMOTE_URL git_update.sh -d ~/website -r V3 $REMOTE_URL
``` ```
@ -44,7 +44,7 @@ DESCRIPTION
git_update.sh will only clone in an empty repository, by default the current working directory. git_update.sh will only clone in an empty repository, by default the current working directory.
If called in a repository with a .git directory, it will update (see below). If called in a repository with untracked files, it will fail. If called in a repository with a .git directory, it will update (see below). If called in a repository with untracked files, it will fail.
Only the commit and the necessary objects will be cloned. The commit can be indicated through a reference, either a tag or branch, otherwise the last commit of main is the default. Only the commit and the necessary objects will be cloned. The commit can be indicated through a reference, either a tag or branch, otherwise the last commit of main is the default.
*CAREFUL*: the command git branch will always show the original branch name and will not follow the eventual branch changes. **CAREFUL**: the command git branch will always show the original branch name and will not follow the eventual branch changes.
git_update.sh clones using git_update.sh clones using
`git clone --recurse-submodules --shallow-submodules --depth=1` `git clone --recurse-submodules --shallow-submodules --depth=1`
@ -62,11 +62,10 @@ git gc --prune=now [--aggressive]"
## Examples ## Examples
A) Cloning the last commit of a branch into a non-existing directory A) Cloning the last commit of a branch into a non-existing directory
`git_update.sh -r myBranch -d myDirectory $REMOTE_URL` `git_update.sh -r myBranch -d myDirectory $REMOTE_URL`
Result: a directory myDirectory has been created in the current working directory. It is filled with the files of the last commit of branch myBranch as well as the .git. The history only shows the last commit. Result: a directory myDirectory has been created in the current working directory. It is filled with the files of the last commit of branch myBranch as well as the .git. The history only shows the last commit.
B) Updating the current working directory repository, moving it from its current state to a certain tag, calling for an aggressive garbage collection. B) Updating the current working directory repository, moving it from its current state to a certain tag, calling for an aggressive garbage collection.
`git_update.sh -r myTag -a $REMOTE_URL` `git_update.sh -r myTag -a $REMOTE_URL`
Result: untracked files are still here. all the tracked files have been changed to respect the tag commit. The history only shows the last commit. Result: untracked files are still here. all the tracked files have been changed to respect the tag commit. The history only shows the last commit.
git gc has been called with the --aggressive option, hence the objects in the .git have been repacked so as to optimize memory. git gc has been called with the --aggressive option, hence the objects in the .git have been repacked so as to optimize memory.