Best practice says that before you commit in git, you need to either do git pull or git fetch/merge. However, there is a way to find out wheather your branches is not in sync with remote.
To check the remote repo status you are really simulating a “fetch”
$ git fetch -v –dry-run
To bring your remote refs up to date
$ git remote -v update
This command will print whether the branch you are tracking is ahead, behind or has diverged with remote. If it says nothing, the local and remote are the same.
$ git status -uno
$ git pull origin <<branchname>>
$ git fetch origin <<branchname>>
$ git merge remote/<<branchname>>
$ git commit
Compare the two branches:
$ git log HEAD..origin/master –oneline
- Terraform Tutorial with Google Cloud – Create Single VM & Network - May 17, 2022
- Terraform Tutorial with Google Cloud – Create Single VM - May 17, 2022
- Google cloud Platform Authentication Method with Terraform - May 17, 2022