From fde8e9d43262362df6a917751f72b50300a2f4d1 Mon Sep 17 00:00:00 2001 From: srdusr Date: Sun, 23 Jul 2023 13:48:42 +0200 Subject: Fixed different git local/remote commits --- tools/git.md | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tools/git.md') 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.` -- cgit v1.2.3