Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

should I make a git push after finish the feature using git flow?

Tags:

git

git-flow

I am using bitbucket and managing with gitflow (or trying to).

My issue is this: I create my feature and i did a

git-flow feature finish name

So, in a tutorial I read I had to do this

git push origin :feature/name

Before that, at the bitbucket I could see the branch, after do the git push origin it was deleted, why?

After finish the feature , should I run that push origin command?

like image 607
jpganz18 Avatar asked Apr 16 '15 10:04

jpganz18


People also ask

What does git flow finish do?

So in our case, when we "finish" a git flow branch, it makes sense to immediately push the branches + tags to the remote instead of having to enter the git flow commands directly. After entering this config, git flow will automatically push the branches on the remote, thus saving extra time and avoiding confusion.

Should Feature branches be pushed?

It's a good idea to push the feature branch up to the central repository. This serves as a convenient backup, when collaborating with other developers, this would give them access to view commits to the new branch.

What is the best branching strategy in git?

Build your strategy from these three concepts: Use feature branches for all new features and bug fixes. Merge feature branches into the main branch using pull requests. Keep a high quality, up-to-date main branch.

What is the difference between git flow and GitHub flow?

Git Flow is usually more complicated than GitHub flow. It is used when your software has the concept of “release”. This flow works perfectly when you work in a team of one or more developers and they collaborate on the same feature.


1 Answers

Before that, at the bitbucket I could see the branch, after do the git push origin it was deleted, why?

The command git-flow feature finish name deletes the branch on your computer, and bitbucket deletes the branch after you push the new update(deleting the branch) to bitbucket.

After finish the feature , should I run that push origin command?

Basically, yes, you should do it. However, if you want to keep the branch on bitbucket as backup, you can skip this step and delete it when you are sure you don't need it anymore.


update for new questions in the comment:

where does that code goes? is it merged with the HEAD revision?

Yes, when you "finish" a feature, the branch is merged to develop, and the feature/ branch will be deleted after merging. You can get the code at HEAD of develop afterwards.

when you use git-flow, the develop and the other branches are created locally only?

YES. Unless you push them to the server (bitbucket, github, or something else)

if I make a git-flow feature finish it was not deleted from bitbucket, what you mean that it is deleted after I make a new update? you mean if I create another feature?

I meant when you do git push origin :feature/name, you push the update(merge the feature branch to develop branch) to bitbucket. And since the update deletes the branch after merging it to develop, bitbucket deletes the branch on the server after getting the update.

lets say the first developer who uses git-flow commits the branches to the remote server and does not delete it, the release 0.1 will be there and the 0.2 and so on, right? any idea how to do that?

Yes. You only need to do the git-flow logic locally and don't push the update that deletes the branch to the server.

and , let say the first developer using gitflow commits the develop branch to the head master, is there any way to make all new developers fork from that branch?

Just ask other developers pull every branch from bitbucket and fork from the branch you want. git-flow is just a philosophy of using git. All the feature/, release/ things are normal branches with pattern name. Treat them like normal git branches, don't think too much.

like image 99
Brian Avatar answered Oct 25 '22 02:10

Brian