E
E
entermix2016-08-03 20:45:17
git
entermix, 2016-08-03 20:45:17

How to properly initialize and maintain a GIT repository?

How to properly initialize and maintain a Feng Shui GIT repository?
Let's say I have a module for CMS, the versions of which are incompatible for updating, I support the module for different versions, how to properly initialize the repository and develop (git flow) on GitHub?
As I understand it, there should be branches:
1.1/master
1.1/develop
1.2/master
1.2/develop
...
For example, at the moment the current version of CMS 1.1 (1.2 has not yet been released), what I do:
1. git init in the module directory
2 Upload the files, make the first commit
3. At the moment there is one master branch, rename it to 1.1/master
4. Add the v.1.0 tag to 1.1/master (for example)
5. Add branch 1.1/develop (need to copy from 1.1/master)?
6. Add a remote repository (github), upload all the changes there
Is that right? I tried to do this, but for some reason the 1.1/develop branch became the main one, and the v1.0 tag was added to both branches. What have I done wrong? Messed up the commands? Perhaps someone will tell you the necessary commands in order of priority?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stanislav Katkov, 2016-08-03
@lunaticman

You don't really understand how git works.
You so smartly mixed branches and tags with each other. Although there is almost no connection between them. It 's common practice to maintain multiple branches with stable versions:
1_1_stable
1_1_development
1_2_stable
1_2_developement
# initialize an empty repository
git init
# create a 1_1_stable branch and push files to the branch
git checkout -b 1_1_stable
<add files>
git commit -m "message here"
git push
# create a branch 1_2_stable and uploading files
git checkout master #just in case, it's better to start with the main branch
git checkout -b 1_2_stable
<add files>
git commit -m "message here"
git push
if you want to do a devel branch, then go to the stable one first:
git checkout 1_1_stable
git checkout -b 1_1_devel
and work with it and merge then into the stable (when ready)
tag'and that's another story - I'm afraid that this will not give you immediate benefit, you will only get more confused. so I advise you not to think too much about tags until you figured out the brunches.

@
@pitrpg, 2016-08-03
_

Here I can advise a good resource that will help you deal with GIT
link

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question