Skip to main content
  1. Notes/
  2. git/

Notes

108 words

Get the last tag:

git describe --abbrev=0 --tags

Export:

git archive --prefix=<TAG>/ <TAG>

Automatically add/remove/update a pathspec:

git add -A 

From the manual:

-A, –all, –no-ignore-removal

Update the index not only where the working tree has a file matching but also where the index already has an entry. This adds, modifies, and removes index entries to match the working tree. If no is given, the current version of Git defaults to “.”; in other words, update all files in the current directory and its subdirectories. This default will change in a future version of Git, hence the form without should not be used.

Get topdir

git rev-parse --show-toplevel