diff options
| author | srdusr <[email protected]> | 2023-02-15 23:54:07 +0200 |
|---|---|---|
| committer | srdusr <[email protected]> | 2023-02-15 23:54:07 +0200 |
| commit | dc145404cff72828974572781e0bd3f88b29de5d (patch) | |
| tree | c2a790b0969343890bba998306950eb6ba3f7792 /tools/git.md | |
| parent | 944e729813e610b09804780251f166e115dbd88c (diff) | |
| download | notes-dc145404cff72828974572781e0bd3f88b29de5d.tar.gz notes-dc145404cff72828974572781e0bd3f88b29de5d.zip | |
Clarified that --squash flag is optional in using git subtrees
Diffstat (limited to 'tools/git.md')
| -rw-r--r-- | tools/git.md | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/git.md b/tools/git.md index 798e319..407bb10 100644 --- a/tools/git.md +++ b/tools/git.md @@ -56,9 +56,9 @@ 2. Add the repo's file path and it's remote url: -NOTE: use the `--squash` flag to omit storing of entire history of subproject into main repo +NOTE: Can use the `--squash` flag to omit storing of entire history of subproject into main repo but if used then the flag will always have to be used with the given repo/subtree and it's commands ```bash - $ config subtree add --prefix /path/to/file <remote-git-repo-url> <branch> --squash + $ config subtree add --prefix /path/to/file <remote-git-repo-url> <branch> # Example: $ config subtree add --prefix .config/nvim https://github.com/srdusr/nvim.git main --squash ``` @@ -66,7 +66,7 @@ NOTE: use the `--squash` flag to omit storing of entire history of subproject in 3. Update to sync/show any changes into dotfiles (upstream repo): ```bash - $ config subtree pull --prefix /path/to/file <remote-git-repo-url> main --squash + $ config subtree pull --prefix /path/to/file <remote-git-repo-url> main ``` 4. Finally push onto remote repository: @@ -76,10 +76,13 @@ NOTE: use the `--squash` flag to omit storing of entire history of subproject in 5. Optional aliases to put into .gitconfig: ```bash [alias] + sba ="!f() { git subtree add --prefix $2 $1 main; }; f" + sbu ="!f() { git subtree pull --prefix $2 $1 main; }; f" + # Or use --squash if prefered sba ="!f() { git subtree add --prefix $2 $1 main --squash; }; f" sbu ="!f() { git subtree pull --prefix $2 $1 main --squash; }; f" # Example: - $ config sbu https://github.com/srdusr/nvim.git .config/nvim + $ config sbu https://github.com/srdusr/nvim.git .config/nvim #--squash ``` - - - |