InterviewSolution
Saved Bookmarks
| 1. |
How do you list the commits missing in your branch that are present in the remote tracking branch? |
|
Answer» 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 JenkinsfileReset ‘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 imagesCompare and list the missing logs in local ‘dev’ branch that are present in ‘origin/dev’ Use ‘git pull’ to sync local ‘dev’ branch with the remote ‘origin/dev’ branch. |
|