From f7e15166980d71a258b60db93b49e5af57803dd8 Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Fri, 26 Jan 2024 21:30:56 +0100 Subject: git: add clean and fetch/pull note --- src/tools/git.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/tools') diff --git a/src/tools/git.md b/src/tools/git.md index a1f4614..33bf858 100644 --- a/src/tools/git.md +++ b/src/tools/git.md @@ -29,6 +29,13 @@ +-------------------+ ``` +## Clean +```markdown + git clean -X ......... remove only ignored files (-n for dry run) + git clean -f -d -x ... remove untracked & ignored files / folders + git clean -e ... exclude pattern from deletion +``` + ## Staging ```markdown git add -p [] ............ partial staging (interactive) @@ -62,6 +69,18 @@ other remote) ``` +## Update local from remote +```markdown + git fetch --prune .................. update all remote references and + remove delete non-existing ones + (does not merge into local tracking branch) + git pull [--rebase] ................ fetch remote references and merge into + local tracking branch (fast-forward by default). + Optionally rebase local tracking branch + on-top of remote branch (in case local + branch has additional commits compared to remote branch). +``` + ## Tags ```markdown git tag -a -m "descr" ........ creates an annotated tag (full object -- cgit v1.2.3