diff --git a/README.md b/README.md index e3e3f8d..a30b3c1 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # 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. -*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 ``` @@ -44,7 +44,7 @@ DESCRIPTION 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. 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 clone --recurse-submodules --shallow-submodules --depth=1` @@ -62,11 +62,10 @@ git gc --prune=now [--aggressive]" ## Examples A) Cloning the last commit of a branch into a non-existing directory - `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. -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` 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.