From 9420b38eb26ef4f31fe63a84169244fde1427031 Mon Sep 17 00:00:00 2001 From: srdusr Date: Mon, 18 Sep 2023 22:24:27 +0200 Subject: Info on fetch --- tools/git.md | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tools/git.md') diff --git a/tools/git.md b/tools/git.md index ede998f..eb3f59d 100644 --- a/tools/git.md +++ b/tools/git.md @@ -171,6 +171,16 @@ $ git remote add origin https://github.com/srdusr/grimoire.git $ git push -u origin ``` +Fetch the most recent changes/commits from the remote branch/repository +> NOTE: make sure to checkout to the desired branch first, example: `git checkout main` +``` +$ git fetch origin +``` +or +``` +$ git fetch origin main:refs/remotes/origin/main +``` + Reset the local main branch to remote repository aka... Delete the most recent commit, destroying the work you've done: -- cgit v1.2.3