Shannon Kularathna
Shannon Kularathna

Reputation: 31

What do I do with a branch after merging it?

We use Git for creating documentation, along with Gitlab. I have a branch, shannon, that I created from the master branch. They're tracking remote branches with the same names.

My typical workflow looks like this:

  1. Do work on my project on shannon
  2. Commit my work to local shannon
  3. Push finished work to remote origin/shannon
  4. Create a merge request on Gitlab from shannon to master

After the merge is completed, I currently keep the shannon branch alive.

I usually pull origin/master into shannon after creating and closing a merge request, just to keep my branch up to date.

This creates the typical merged master into shannon from < url > commit that is then visible in future merge requests.

Am I doing this right? Should I instead be deleting shannon after a successful merge request and recreating it when I start work again?

I really appreciate any help you can give me! Maybe there's a way to make my workflow more efficient.

Upvotes: 1

Views: 134

Answers (1)

Nayan
Nayan

Reputation: 658

  • All other things you are doing is fine but, all the time for new feature try to make a new branch for both local and remote and keep both feature branch in sync.

  • Keep local and remote master in sync and create branch from master.

  • In gitlab there is a option with merge request delete branch on merge. You can use that so you need not to worry about deleting manually.

  • Also make sure the if someone join your team and you are working on same master than in your practice add to take a pull then push to remote branch to prevent any merge issues.

Upvotes: 1

Related Questions