Aptana, SourceTree and Git - Beginner

I'm just starting to use version control, and my head is spinning! I am trying to wrap my head around branches, validating, merging and reloading. I am sure these are stupid questions, but really appreciate some help.

My projects are PHP. I use Aptana Studio for my IDE, Bitbucket and SourceTree for the Git GUI.

Therefore, I think I can have a general idea of ​​how this should work now. Please tell me where I am going wrong.

Let's say I want to add a new function. I have a branch of the master. In Aptana, I can right-click the file -> Go to command , and then create a new branch. I can name this feature a1bc branch. I am making my changes.

As soon as I am done with this function and all the changes, I click CommandCommit , then CommandMerge BranchWizard . This will merge my changes back into the master repo.

Is this roughly how I will add features, etc.? And what should I do if I have another 100 functions over time? Do I keep all these function branches or delete them after combining them?

+4
source share
1 answer

You need to decide whether you go back to master as a merge with fast forward or not :

git merges

Since the branches are made to isolate the work (see " When you should join the branch "), you can regularly include your feature go to master , continuing to develop the specified function in the feature branches.
In this case, merge --no-ff is recommended (and given the settings of Aptana, it is better to do it on the command line ).

However, if you created a branch to isolate short-burned development, you can include the feature branch in master through accelerated merging (to completely “mix” the two branches).
If master had some commits during feature development, you first need to overload feature on top of master , then merge feature into master (this will be fast forward).

See details

+7
source

Source: https://habr.com/ru/post/1401919/


All Articles