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
To pull
$ git pull origin <<branchname>>
or
$ git fetch origin <<branchname>>
$ git merge remote/<<branchname>>
$ git commit
Compare the two branches:
$ git log HEAD..origin/master –oneline
Git Fundamental Tutorials 2020 by Guru
Git Fundamental Tutorials with Basic Demo by Raman in 2020
Git Fundamental Tutorial for Beginners with Demo 2020 — By DevOpsSchool
Git fundamental using github crash tutorials may 2020 – By DevOpsSchool
Git Advance Tutorial – By DevOpsSchool.com
Git Advance Tutorial for Beginners with Demo (2020) — By DevOpsSchool
Git Advance Tutorial for Beginners with Demo 2020 — By DevOpsSchool
Git Advance Tutorial for Beginners with Demo 2020 — By DevOpsSchool
Git Advance Tutorial for Beginners with Demo {2020} — By DevOpsSchool
Latest posts by Rajesh Kumar (see all)
- What is Mobile Virtual Network Operator? - April 18, 2024
- What is Solr? - April 17, 2024
- Difference between UBUNTU and UBUNTU PRO - April 17, 2024