Git Workflow To Enterprise Gitlab Instance

less than 1 minute read

Description:

Similar to my post on how to connect Git 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.

To Resolve:

  1. First follow the steps in Connect to Github to setup your repo to where you can make changes.

  2. Now just check out the development branch:

    1
    2
    
    cd /to/your/git/directory
    git checkout development
    
  3. Make changes and push often with git push and use git status to see if you have any issues.

  4. 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
    
  5. Switch back to your local working branch and keep making changes for the next push.

    1
    
    git checkout development
    

-----------------------------------------------------------
Spotted a mistake in this article? Why not suggest an edit!
-----------------------------------------------------------

Comments