bitbucket - doubt about workflow, branchs and merge

Asked

Viewed 326 times

6

My team and I started working with git for version control (later I know), and used bitbucket as a remote repository (because it allows free private repository).

Well, I have some questions for the workflow.

The programmer is working on the master branch, as it is the basis of the ongoing project.

I’m working on the "front-end" branch as I’m working on the styles for the responsive layout.

How we should always work with correct files?

I’m thinking, at the end of the day, to merge the "front-end" branch in the "master", and then pull the master in my local base and the changes apply in the "front-end" branch until the project is finished.

That is correct?

3 answers

3

Maybe this flow will help you.

Create the branch:

git branch frontend
git checkout frontend

But if you want someone else to contribute changes to that branch as well. You can create a remote branch

git push origin frontend

to copy a remote branch locally

For your colleagues to contribute to a particular remote branch, they need to copy it locally.

git checkout -t origin/frontend

Then you just merge

git checkout master
git merge frontend

To avoid polluting your repository, a good practice is to remove branches that are no longer needed. To do this, just run the following command:

git push origin :frontend

2

This is a workflow query with git, this is common to happen when you want to work with multiple branch’s, I’ll show git Successful workflow.

Here has a good example of how to work this way, I also recommend reading about workflow with pull request, this can be a viable solution for you depending on your form of software delivery.

  • Great link, a lot of people work like this

1

In addition to the options of workflow here presented, it may be interesting to use also in a complementary way some system of Continuous Integration as the Jenkins, that can be configured to automate the merges, builds and deploys of the application.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.