srdusr
aboutsummaryrefslogtreecommitdiffstats
path: root/tools/git.md
diff options
context:
space:
mode:
authorsrdusr <[email protected]>2023-07-23 13:48:42 +0200
committersrdusr <[email protected]>2023-07-23 13:48:42 +0200
commitfde8e9d43262362df6a917751f72b50300a2f4d1 (patch)
tree568e920a989c51a37ec7060c531a8c230be95c2e /tools/git.md
parent597abaa476677a102c607b78b779cc1ce3c4ca70 (diff)
downloadnotes-fde8e9d43262362df6a917751f72b50300a2f4d1.tar.gz
notes-fde8e9d43262362df6a917751f72b50300a2f4d1.zip
Fixed different git local/remote commits
Diffstat (limited to 'tools/git.md')
-rw-r--r--tools/git.md9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/git.md b/tools/git.md
index 52a4ba2..1616b31 100644
--- a/tools/git.md
+++ b/tools/git.md
@@ -48,6 +48,15 @@
```bash
$ config checkout
```
+git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main
+git branch -u origin/branchName
+or
+git branch --set-upstream-to=origin/master main
+git update-ref refs/heads/master origin/master
+
+You can also set it with a push
+git push -u origin master
+git push --set-upstream origin master
#### 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.`