To update your local Git repository with the new commits from the remote SSH server repository, you need to fetch the changes from the remote and then merge or rebase them into your local branch. Since you cloned the repository via SSH, your remote is already configured to use SSH.
Here’s how to do it:
bashcd /path/to/your/local/repository
This downloads all new commits, branches, and tags from the remote repository, but does not merge them into your local branches.
bashgit fetch origin
(Replace origin with the name of your remote if it’s different.)
You have two main options:
This creates a merge commit in your local branch.
bashgit merge origin/main
(Replace main with your branch name, e.g., master or develop.)
This replays your local commits on top of the remote changes, for a cleaner history.
bashgit rebase origin/main
(Again, replace main with your branch name.)
bashcd /path/to/your/local/repository git fetch origin git merge origin/main # or git rebase origin/main
git stash them before fetching, or commit them first.Then you can simply run:bashgit config --global pull.rebase true
bashgit pull