Gameboy emulator Part 3: setting up GitHub

Now that I have a base set up, it’s time to start using git to track changes. Of course this probably would have been easier to do from the start but whoever does things the easy way?

By now, the folder structure is a bit messy thanks to CLion and CMake but that won’t be a concern soon

SameBoy/
├── build
│   └── deleteme.txt
├── cmake-build-debug
│   ├── build.ninja
│   ├── .cmake
│   │   └── api
│   │       └── v1
│   │           ├── query
│   │           │   ├── cache-v2
│   │           │   ├── cmakeFiles-v1
│   │           │   ├── codemodel-v2
│   │           │   └── toolchains-v1
│   │           └── reply
│   │               ├── cache-v2-ee02b97f5c6629b0a94d.json
│   │               ├── cmakeFiles-v1-9dfc6592c530b5f35056.json
│   │               ├── codemodel-v2-9be2ad13824cab922258.json
│   │               ├── directory-.-Debug-f5ebdc15457944623624.json
│   │               ├── index-2025-01-02T09-19-43-0866.json
│   │               ├── target-SameBoy-Debug-f50212018887c1354457.json
│   │               └── toolchains-v1-7096c62e23c342eb06a8.json
│   ├── CMakeCache.txt
│   ├── CMakeFiles
│   │   ├── 3.30.5
│   │   │   ├── CMakeCCompiler.cmake
│   │   │   ├── CMakeCXXCompiler.cmake
│   │   │   ├── CMakeDetermineCompilerABI_C.bin
│   │   │   ├── CMakeDetermineCompilerABI_CXX.bin
│   │   │   ├── CMakeSystem.cmake
│   │   │   ├── CompilerIdC
│   │   │   │   ├── a.out
│   │   │   │   ├── CMakeCCompilerId.c
│   │   │   │   └── tmp
│   │   │   └── CompilerIdCXX
│   │   │       ├── a.out
│   │   │       ├── CMakeCXXCompilerId.cpp
│   │   │       └── tmp
│   │   ├── clion-Debug-log.txt
│   │   ├── clion-environment.txt
│   │   ├── cmake.check_cache
│   │   ├── CMakeConfigureLog.yaml
│   │   ├── CMakeScratch
│   │   ├── pkgRedirects
│   │   ├── rules.ninja
│   │   ├── SameBoy.dir
│   │   │   └── source
│   │   └── TargetDirectories.txt
│   ├── cmake_install.cmake
│   └── Testing
│       └── Temporary
│           └── LastTest.log
├── CMakeLists.txt
├── .idea
│   ├── .gitignore
│   ├── misc.xml
│   ├── modules.xml
│   ├── SameBoy.iml
│   └── workspace.xml
└── source
    └── main.cpp

I’ll start with git init then create a .gitignore straight away

Of course git init added a lot to the folder as well:

(I’ll start using HTML from the terminal and doing these in color)

SameBoy/
├── build
│   └── deleteme.txt
├── cmake-build-debug
│   ├── build.ninja
│   ├── .cmake
│   │   └── api
│   │       └── v1
│   │           ├── query
│   │           │   ├── cache-v2
│   │           │   ├── cmakeFiles-v1
│   │           │   ├── codemodel-v2
│   │           │   └── toolchains-v1
│   │           └── reply
│   │               ├── cache-v2-ee02b97f5c6629b0a94d.json
│   │               ├── cmakeFiles-v1-9dfc6592c530b5f35056.json
│   │               ├── codemodel-v2-9be2ad13824cab922258.json
│   │               ├── directory-.-Debug-f5ebdc15457944623624.json
│   │               ├── index-2025-01-02T09-19-43-0866.json
│   │               ├── target-SameBoy-Debug-f50212018887c1354457.json
│   │               └── toolchains-v1-7096c62e23c342eb06a8.json
│   ├── CMakeCache.txt
│   ├── CMakeFiles
│   │   ├── 3.30.5
│   │   │   ├── CMakeCCompiler.cmake
│   │   │   ├── CMakeCXXCompiler.cmake
│   │   │   ├── CMakeDetermineCompilerABI_C.bin
│   │   │   ├── CMakeDetermineCompilerABI_CXX.bin
│   │   │   ├── CMakeSystem.cmake
│   │   │   ├── CompilerIdC
│   │   │   │   ├── a.out
│   │   │   │   ├── CMakeCCompilerId.c
│   │   │   │   └── tmp
│   │   │   └── CompilerIdCXX
│   │   │       ├── a.out
│   │   │       ├── CMakeCXXCompilerId.cpp
│   │   │       └── tmp
│   │   ├── clion-Debug-log.txt
│   │   ├── clion-environment.txt
│   │   ├── cmake.check_cache
│   │   ├── CMakeConfigureLog.yaml
│   │   ├── CMakeScratch
│   │   ├── pkgRedirects
│   │   ├── rules.ninja
│   │   ├── SameBoy.dir
│   │   │   └── source
│   │   └── TargetDirectories.txt
│   ├── cmake_install.cmake
│   └── Testing
│       └── Temporary
│           └── LastTest.log
├── CMakeLists.txt
├── .git
│   ├── branches
│   ├── config
│   ├── description
│   ├── HEAD
│   ├── hooks
│   │   ├── applypatch-msg.sample
│   │   ├── commit-msg.sample
│   │   ├── fsmonitor-watchman.sample
│   │   ├── post-update.sample
│   │   ├── pre-applypatch.sample
│   │   ├── pre-commit.sample
│   │   ├── pre-merge-commit.sample
│   │   ├── prepare-commit-msg.sample
│   │   ├── pre-push.sample
│   │   ├── pre-rebase.sample
│   │   ├── pre-receive.sample
│   │   ├── push-to-checkout.sample
│   │   └── update.sample
│   ├── info
│   │   └── exclude
│   ├── objects
│   │   ├── info
│   │   └── pack
│   └── refs
│       ├── heads
│       └── tags
├── .idea
│   ├── .gitignore
│   ├── misc.xml
│   ├── modules.xml
│   ├── SameBoy.iml
│   └── workspace.xml
└── source
    └── main.cpp

So I’ll start making the .gitignore:

# JetBrains
.idea/

# CMake
build/
cmake-build-debug/

# Misc
ROMs/

Then add all this as the first commit:

git add .gitignore
git add --all
git commit -m "Initial commit"

Then link and push to github: (repo will need to exist already)

git remote add origin git@github.com:doglitbug/SameBoy.git
git push -u origin main

From here I usually like to make a working branch that has work in progress, while main is left to be in a working state. Poor choice of naming I know.

git checkout -b working
git push --set-upstream origin working

So now when I call tree –gitignore . I get the following clean folder structure:

/SameBoy
├── CMakeLists.txt
└── source
    └── main.cpp

Leave a Reply

Your email address will not be published. Required fields are marked *

Hey!

Hello! I’m doglitbug, a 40 yo software engineer from New Zealand. This blog is to chronicle my exploits outside of work, hobbies etc!

Categories