Using Git for Modding
Instructions originally written by Medik on Discord, who deserves full credit for inspiring this page.
Git is a version control tool used in both professional and hobby environments. It tracks changes made, has powerful version comparison and control, and offers an industry-relevant, professional way to create mods for a fairly low learning investment.
If combined with a site such as Github, this process can allow teams to collaborate without stepping on each other's toes, to more clearly observe what is happening and who does what, and even allow unrelated people to offer suggestions and report bugs in the same interface.
- Install Git (official download for windows)
- Open a terminal and navigate to your mod folder (e.g:
cd C:\Users\eddie\games\medieval II total war\mods\my_important_mod)
- Create a new .gitignore file (example: DAC gitignore on github) to tell Git to ignore certain files (such as images, models and textures as desired)
git initto tell Git to watch the directory
git add .to add all your existing files that work
git commit -m "Adding working files"
- Repeat the
git add .and
git commit -m "Some appropriate message detailing what changes you made"steps as you make changes or discard them if you don't want them
You should now have a working local Git repository!
See the following YouTube video for a primer on making the most with Git:
You can also manage Git graphically if you prefer.
Free Git Hosting Services
There should not be issues with publishing (for example) a Medieval 2 mod folder to GitHub, but attribution/permission from original creators should be observed if this is being done with existing projects. Obviously, publishing copyrighted works and core game files should not be done.