[Tutor] OT: How best to use Git for multi-directory projects?

boB Stepp robertvstepp at gmail.com
Tue Dec 29 23:38:11 EST 2015


I have two situations that I wish to use Git for:  1) Multi-directory
Python projects and 2) learning Python from various books which
inevitably have suggested exercises to program solutions for.

For (1) I might have multiple projects going simultaneously.  Say
something like:

project1/
....source/
....tests/
....data/
....etc

project2/
....etc

projectn/
....etc

My thoughts are that each project should have its own .git file.  If
this is correct, then I further think that there should be a single
.git file to track everything in each project folder at its top level
and use git add . at the project folder level to add anything that has
been added anywhere in any subfolder of the project folder.  Am I
thinking correctly in this?

For (2) I first want to state publicly:

New Year's Resolution:

I WILL study--in parallel--the following three books from cover to
cover, doing ALL non-trivial exercises:
    "Think Python, 2nd Edition" by Allen Downey
    "Introduction to Computation and Programming Using Python, Revised
and Expanded Edition" by John V. Guttag
    "Python Crash Course" by Eric Matthes

I hope that by saying this openly I will actually DO what I mean to
do!  I am tired of "Easter-egging" Python, able to use lots of
different features, but with no thorough understanding/mastery of
anything.  The first two books are to get down basic intro to CSc
topics which have probably evolved since the mid- to late-seventies
when I took my basic CSc courses, while the third hopefully will fill
in Python language features and syntax that the first two books skip.

But to the questions.  This seems essentially parallel to (1) in
regards to using Git.  I want to track all of the programming work I
do for these 3 books.  I anticipate a directory structure similar to:

StudyBooks/
    Book1/
        Ch1/
            example1.py
            example2.py
            exercise1.py
            etc
        Ch2/
        etc

    Book2/
etc.

Since I will be studying these 3 books in parallel, would it make
sense to track everything with a single .git file at the level of
StudyBooks directory?

Hoping to more effectively use Git in the new year!

-- 
boB


More information about the Tutor mailing list