0
votes

Git repo maintains origin/develop branch copy for develop branch.

git push origin develop from my laptop, sync up origin/develop branch

When I create a webhook(web integrations option) on GitLab portal with Jenkins, I see branches develop, master etc... but not origin\develop or origin/master.

I select develop branch and select "push events" and web hook

As per console log,

Checking out Revision 3fffffffffffffhjggjj3fffffffffffffhjggjj (refs/remotes/origin/develop) is shown in Jenkins, on webhook trigger,

for the corresponding groovy script git(branch: 'develop', credentialsId: credential, url: "${gitLabServer}/${projName}/${repoName}.git")


When user says, git push origin develop on his laptop,

Is webhook triggering jenkins pipeline on push event to origin/develop? Because I didn't create webhook for origin/develop... in pipeline I checkout code from develop branch

1
A normal origin/develop is a client-side branch. The webhooks does not care about the update of origin/develop. It is invoked by the push event that happens to the branch develop in the server-side repository.ElpieKay
@ElpieKay If webhooks does not care about origin/develop, then why would I see Checking out Revision 3fffffffffffffhjggjj3fffffffffffffhjggjj (refs/remotes/origin/develop) in console log of Jenkins, on webhook trigger? In groovy script, we write git(branch: 'develop', credentialsId: credential, url: "${gitLabServer}/${projectName}/${repositoryName}.git") mohet

1 Answers

2
votes

develop

develop is the branch on your machine/Jenkins server/any client.

origin

origin is the pointer to the location where your repository resides.

origin/develop

Complete path(location) of your develop branch on the repository.

when you are working on your development machine you will clone/fetch the repository and check out a particular branch to work on it say develop. once you finish your code you push it back to your repository by executing git push origin develop. This means you want to push your branch develop to origin and branch develop.

Coming to Jenkins integration, on Gitlab you are already on your repository and it has no other remote location to push so there won't be any concept of origin/develop where you are already on origin.