-
Notifications
You must be signed in to change notification settings - Fork 1
Git Tips
Jaeyoung Lee edited this page Jun 21, 2024
·
5 revisions
- https://docs.github.com/en/get-started/using-git/splitting-a-subfolder-out-into-a-new-repository
- git-filter-repo
sudo apt-get install git-filter-repo
git filter-repo --subdirectory-filter FOLDER-NAME
# Filter the specific branch by using a single sub-directory as the root for the new repository
git log --follow -p // follow history of renamed files
sudo apt-get install -y tig
tig --follow -p
1. git remote add -f Bproject /path/to/B
2. git merge -s ours --no-commit --allow-unrelated-histories Bproject/master
3. git read-tree --prefix=dir-B/ -u Bproject/master
4. git commit -m "Merge B project as our subdirectory"
5. git pull -s subtree Bproject master
1. name the other project "Bproject", and fetch.
2. prepare for the later step to record the result as a merge.
3. read "master" branch of Bproject to the subdirectory "dir-B".
4. record the merge result.
5. pull in subsequent update from Bproject using "subtree" merge
- https://medium.com/walkme-engineering/how-to-merge-a-git-submodule-into-its-main-repository-d83a215a319c
- https://docs.github.com/en/get-started/using-git/about-git-subtree-merges
- https://stackoverflow.com/questions/4022180/how-to-add-a-custom-macro-when-using-ndk
- https://stackoverflow.com/questions/9869349/shell-script-call-from-android-mk-standard-output-and-missing-separator-error
- https://stackoverflow.com/questions/1404796/how-can-i-get-the-latest-tag-name-in-current-branch-in-git
- https://stackoverflow.com/questions/5694389/get-the-short-git-version-hash
$ git describe --tags
v0.3.1-2-g07736b5
$ git rev-parse --short HEAD
07736b5
$ git rev-parse --abbrev-ref HEAD
main
$ git tag -n
docker-v0.0.3 update: update comments in nesfr_vr_remote_tunnel.service
docker-v0.0.4 docker-v0.0.4
docker-v0.1.0 update: remove acpid-poweroff
v0.0.0 initial version
v0.1.0 update: update scripts for debian packaging
v0.3.0 update: subscribe current pose from rover
$ git describe --tags
docker-v0.1.0-5-g7668341 // <- latest tag
$ git describe
docker-v0.0.4-15-g7668341 // <- annotated tag
$ git describe --tags --match="v*"
v0.3.0-6-g7668341 // <- matching pattern
$ git describe --all --tags --match="v*"
tags/v0.3.0-6-g7668341