How do you list the commits missing in your branch that are present in the remote tracking branch?

Devops Devops in Devops . 3 years ago

  2   0   0   0   0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

git log --oneline <localBranch>..<origin/remoteBranch>

Your local git branch should be SET up to track a remote branch.

Divya1@DIVYA:initialRepo [dev] $git branch -vv * dev    b834dc2 [origin/dev] Add Jenkinsfile  master b834dc2 [origin/master] Add Jenkinsfile

Reset ‘dev’ commit history to 3 commits behind using the command:

Divya1@Divya:initialRepo [dev] $git reset --soft HEAD~3 Divya1@Divya:initialRepo [dev] $git branch -vv * dev    30760c5 [origin/dev: behind 3] add source code auto build at every code CHECKIN using docker images

Compare and list the missing logs in local ‘dev’ branch that are present in ‘origin/dev’

Divya1@Divya:initialRepo [dev] $git log --oneline dev..origin/dev b834dc2 (origin/master, origin/dev, master) Add Jenkinsfile c5e476c Rename 'prod' to 'uat'-break the build in Jenkings 6770b16 Add database logs.

Use ‘git pull’ to sync local ‘dev’ branch with the remote ‘origin/dev’ branch.

Posted on 31 May 2022, this text provides information on Devops related to Devops in Devops. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Tuteehub forum answer Answers

Post Answer

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.