01 Setup - 2altoids/squeak-game-engine GitHub Wiki
Previous: 00 Resources
Estimated completion time: 35 minutes.
The first chapter in creating this thing from scratch is setting up the repository.
GitHub
Repository creation
The project begins by creating the repository on GitHub. Here I created a mostly empty README.md which appears nicely formatted on the repo's GitHub page.
Here I also make a .gitignore, choosing the C++ template. More stuff will need to be added to it later, but for now it is fine.
GitHub and Git
To make pushing commits to GitHub easier, I set up SSH keys for my PC so I don't have to enter my username and password every time I push. GitHub's "Connecting to GitHub with SSH" article walks through the steps. SSH is not necessary, but it's nice. Doing this again fresh, it took me about 25 minutes.
Secondly, I checked my Git configuration with the command git config --list to make sure my name, email address, and preferred editor for writing commit messages are correct. For more info see Git's setup page on the matter.
Cloning the repo
The repo is cloned using git clone and then the SSH or HTTPS location. (how-to)
Personally I prefer the master branch to be called master and not the more politically-correct main, so I rename it like so:
git branch -m main master
git push -u origin master
git remote set-head origin master
# Now go to github in a browser,
# open the repo, click settings, branch and change the default branch to master
git push origin --delete main
Courtesy to Haaroon for supplying this gist.
For branch workflow, I prefer this setup:
- A
masterbranch for completed important milestones, where I can tag commits with release numbers. - A permanent
devbranch, to where new features are merged and from where work is occasionally merged intomaster - Short-lived feature branches that are branched from and merged into
dev.
This in my view is lightweight enough for a personal project but still retains the benefits of using branches.
Next: 02 CMake Project