Welcome to the TWC Wiki! You are not logged in. Please log in to the Wiki to vote in polls, change skin preferences, or edit pages. See HERE for details of how to LOG IN.

Difference between revisions of "Using Git for Modding"

From TWC Wiki
Jump to navigationJump to search
(Using with GitHub)
(Offline Use)
 
(7 intermediate revisions by 2 users not shown)
Line 6: Line 6:
  
 
==Using Git==
 
==Using Git==
===Offline use===
+
===Offline Use===
 +
[[File:ExampleCommit.png|640px|thumb|An example commit on GitHub]]
 
# Install Git ([https://git-scm.com/download/win official download for windows])
 
# Install Git ([https://git-scm.com/download/win official download for windows])
 
# Open a terminal and navigate to your mod folder (e.g: <code>cd C:\Users\eddie\games\medieval II total war\mods\my_important_mod</code>)
 
# Open a terminal and navigate to your mod folder (e.g: <code>cd C:\Users\eddie\games\medieval II total war\mods\my_important_mod</code>)
Line 13: Line 14:
 
# Run <code>git add .</code> to add all your existing files that work
 
# Run <code>git add .</code> to add all your existing files that work
 
# Run <code>git commit -m "Adding working files"</code>
 
# Run <code>git commit -m "Adding working files"</code>
 +
# Repeat the <code>git add .</code>and <code>git commit -m "Some appropriate message detailing what changes you made"</code> steps as you make changes or discard them if you don't want them
  
You should now have a working local git repository! Consult one of the following guides for instructions how to make the most of git from the command line:
+
You should now have a working local Git repository!  
* guides for basic git use here
+
 
 +
See the following YouTube video for a primer on making the most with Git:
 +
*  [https://www.youtube.com/watch?v=hwP7WQkmECE Git in 100 Seconds]
 +
* [https://www.youtube.com/watch?v=i_23KUAEtUM Using Git with Visual Studio Code]
  
 
You can also manage Git graphically if you prefer.
 
You can also manage Git graphically if you prefer.
* graphical git tools here
+
* [https://desktop.github.com/ GitHub Desktop]
 +
*  [https://www.gitkraken.com/ Git Kraken]
  
 
===Free Git Hosting Services===
 
===Free Git Hosting Services===
 +
* [https://github.com Github]
 +
* [https://about.gitlab.com/ GitLab]
 +
* [https://sourceforge.net/ SourceForge]
  
* [//https://github.com/ Github]
+
==Additional Considerations==
* [//https://about.gitlab.com/ GitLab]
+
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.
* [//https://sourceforge.net/ SourceForge]
 
  
==Additional considerations==
+
[[Category:Modding]]
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.
 

Latest revision as of 16:45, 25 October 2023

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.

Using Git

Offline Use

An example commit on GitHub
  1. Install Git (official download for windows)
  2. Open a terminal and navigate to your mod folder (e.g: cd C:\Users\eddie\games\medieval II total war\mods\my_important_mod)
  3. 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)
  4. Run git init to tell Git to watch the directory
  5. Run git add . to add all your existing files that work
  6. Run git commit -m "Adding working files"
  7. 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

Additional Considerations

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.