Embedding Username and Token in the URL to Access GitLab
This is an example of how to embed a username and private token when cloning a GitLab repository,
$ git clone https://myusername:glpat-mytoken@gitlab.com/myusername/myrepository.git
This is an example of how to embed a username and private token when cloning a GitLab repository,
$ git clone https://myusername:glpat-mytoken@gitlab.com/myusername/myrepository.git
Basically all you need is your repository url, username and password.
First is adding your git username and password on Jenkins credentials,

And after that, we can create a username and password credentials, and we give an id with the name of “devops”.

Use this jenkins script to execute git commands,
node('maven') {
stage('Clone') {
sh "git config --global http.sslVerify false"
git branch:"branch-01", url:"https://git.mygit.id/git/something/project.git", credentialsId:'devops'
}
}
Beberapa kali selalu gagal merge di netbeans, dan somehow git flow di netbeans tidak begitu intuitif terkait hal ini. Walaupun sudah di merge di netbeans, namun sepertinya selalu gagal untuk push ke server. Workaroundnya adalah seperti ini, buka command prompt lalu jalankan command ini.
Simpan perubahan ke branch lain,
git stash
Tarik perubahan dari server,
git pull
Implementasikan hasil branch keatas hasil pull,
git stash pop