GNU/Linux Desktop Survival Guide
by Graham Williams |
|||||
Git Workflow |
20190415 A fetch updates the local copy of the repository to match the remote repository. It will not modify your working copy of the files at all.
$ git fetch |
A pull will first do a fetch and then a merge.
A diff will show changes made to the local main branch versus the repository main branch using difftool:
$ git difftool origin/main main |
To match our local main branch with the remote main branch we rebase our repository:
$ git rebase |
We can hand merge or use the mergetool to interactively resolve any conflicts between local changes and remote changes:
$ git mergetool |
To list all local commits we can query the log
$ git log --oneline |
To list the repository commits (after a fetch) we also query the log:
$ git log origin/main --oneline |