Similar to my post on how to connect to Github, this post is how to use Git to connect to an enterprise internal Gitlab instance. First, find out what branches exist in your company and what their workflow is. It is typically like: development => testing => production. So you will ‘checkout’ development, make changes locally by ‘commiting’, then ‘pull/push’ often to development branch. When you reach a checkpoint, you will ‘merge’ development into testing/production assuming the code passes all checks.
First follow the steps in Connect to Github to setup your repo to where you can make changes.
Now just check out the development branch:
cd /to/your/git/directory git checkout development
Make changes and push often with
git pushand use
git statusto see if you have any issues.
Lastly, to merge the development branch with upstream branches, you have to check them out and merge them.
1 2 3 4 5 6 7
git checkout testing git pull testing git merge development git checkout production git pull production git merge testing
Switch back to your local working branch and keep making changes for the next push.
git checkout development