3

I am beginner in Git & Github. I need help with good/ ways to handle maintaining code base for python 2.7 and python 3. Currently we have written our code to work with python 2.7. But we are porting it to Python 3.6. We still need to maintain and run the application in 2.7 and do some bug fixes as and when this comes. I need help on how to handle this situation and detailed explanation of maintaing branches/ releases.

Currently there is just 1 master branch. Based on features that come in we create branch work on it and do a merge to master. I have not tried anything to handle releases or how to handle the 2.7 bug fixes

Sowmya
  • 41
  • 2
  • That seems similar to https://stackoverflow.com/questions/34442468/git-branch-or-tag, but https://blog.ram.rachum.com/post/72983007520/support-py2-3-in-two-separate-codebases-how-to-do can help too. – VonC Jul 31 '19 at 04:39
  • From what I can see, you don't have much of a way around maintaining a separate long running branch for Python 2. – Tim Biegeleisen Jul 31 '19 at 04:42
  • @VonC . Thank you. But still not clear how do we handle bug fixes. Does the branch for Python 2.7 remain as is? From the writeup, i feel there is no need to have a Tag. Can you suggest? – Sowmya Jul 31 '19 at 06:06

1 Answers1

1

While this question or the blog post "Support Py2+3 in two separate codebases: How to do it and why it’s great" both suggests separate branches or codebase (repositories), their different nature means: no merge. Tags are not involved.

So if you have a bugfix which could be retrofitted between python2 and python3, you would make a patch and apply it to your other branch or repository.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250