diff options
Diffstat (limited to 'tools/git.md')
| -rw-r--r-- | tools/git.md | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/git.md b/tools/git.md index a926b00..b79677a 100644 --- a/tools/git.md +++ b/tools/git.md @@ -49,6 +49,9 @@ #### Use git subtree to sync other repos into dotfiles 1. First make sure dotfiles is up-to date or commit/push/reset all changes otherwise this error message will show: `Working tree has modifications. Cannot add.` + ```bash + $ config reset --hard origin/main + ``` Also NOTE: the prefix (subdirectory in which you will add the subtree) cannot already exist therefore delete/backup locally. @@ -102,13 +105,14 @@ Push the changes/commits onto repo: ```bash $ git push -u origin <branch> ``` -Delete the most recent commit, keeping the work you've done: +Reset the local main branch to remote repository aka... +Delete the most recent commit, destroying the work you've done: ```bash -$ git reset --soft origin/<branch> +$ git reset --hard origin/main ``` -Delete the most recent commit, destroying the work you've done: +Delete the most recent commit, keeping the work you've done: ```bash -$ git reset --hard origin/<branch> +$ git reset --soft origin/<branch> ``` Allow unrelated histories when two unrelated projects are merged/unaware of each other's existence: |