3

I have a folder similar to this:

Hello World
├── Hello World 1.0.py
├── Hello World 2.0.py
├── Hello World 2.1.py
└── Changelog.txt

Where "Changelog.txt" is something like:

2.0: Added a pause at the end.

2.1: Changed pause to os.system("pause").

Obviously this is not the best solution for version control. How can I use Git to organize my project? Ideally, I'd want a folder somewhat like this:

Hello World
├── Hello World.py
└── .git
    └── (...)

But I don't want to lose the version numbers and changelog comments.


More information:

I'm completely new to Git. I've looked at similar questions like:

What is git tag, How to create tags & How to checkout git remote tag(s)

What is the Git equivalent for revision number?

How to manage the version number in Git?

But they seem too technical for me right now and it doesn't look like they address my specific problem.

Wood
  • 271
  • 1
  • 8

1 Answers1

3

What you need is an introductory course on git. You can find tons of free ones online. Very basic use of git is all you need.

Your "changelog comments" will turn into git commit messages. You can include a "revision number" as part of your commit message if you like.

The git log will be your new changelog.

At this stage the only git commands you need are init (one time only), add, commit, status and log.

EDIT:

e.g.

git init
git add .
git commit -m '1.0: first version'
(make changes)
git add .
git commit -m '2.0: Added a pause at the end.'
(make changes)
git add .
git commit -m '2.1: Changed pause to os.system("pause").'
git log
(you will see both a list of all 3 commits along with your messages)
JoelFan
  • 37,465
  • 35
  • 132
  • 205
  • I've read tutorials, watched introductory videos, and read questions and answers about Git. None addressed my specific problem. I don't want to use any of the advanced features of Git yet, I just want to solve an extremely basic problem. There's gotta be a very simple solution to it that can be explained in one paragraph. And I definitely don't need a whole course on Git to learn the very basics of it. – Wood Jan 23 '20 at 23:14
  • 1
    What's wrong with what I suggested? Each commit message has the revision number and the details about it. When you do a `git log` you will see all your revisions along with their details. No need for a changelog file. – JoelFan Jan 23 '20 at 23:20
  • 1
    Git tags are also helpful. – Tom Shaw Jan 24 '20 at 00:00
  • The problem was that I was looking for some built-in way of organizing the version numbers, like tags, but your suggestion is good enough. It's simple and solves my problem. – Wood Jan 24 '20 at 00:20
  • 1
    @Wood. You can have the above AND tags. Simply add `git tag my_tag_name` whenever you have committed something that you consider being a correct version (in the above example, after each commit...) – Zeitounator Jan 24 '20 at 14:00