git is a little tricky, but I’ll give you 5 minute course:
git doesn’t care how you edit files. So just open up the files in notepad++ and type away.
when you are satisfied with your changes, tell git that you want to add those changes to your next commit
git add $FILENAME
where $FILENAME is the path relative to the base directory. So for your M24, that would data/json/items/gun/308.json. You can add multiple files with the same git add command, or at different times.
adding a file to a commit doesn’t really do anything except tell git that you’ll want to commit it later. You can keep editing it, and add the new changes to the existing commit by running git add again.
when you’re completely satisfied with your changes and have added all the changes you want to make to this commit, type
git commit
this will spawn an editor window, which gives you the option to describe your changes. when you’re done editing the description, git will commit the changes.
a git commit is a collection of changes grouped together. you can see the list of all the commits in your repository with
git log
which puts out something that looks like this:
commit 920230300571fcc8d716c4e8f1d976780ec5275f
Author: Mark Langsdorf <mark.langsdorf@gmail.com>
Date: Wed Jul 25 13:10:28 2018 -0500
vehicle part descriptions: more scrolling fixes, always display if possible
limit the maximum amount of scroll based on the size of the w_msg, prevent
accumulation of scroll passed the maximum or minimum amount, and always
display the vehicle part descriptions if the w_msg isn't being used to
display something else.
commit 464ada3c482463c863f01874d66e1bb110ff39cf
Author: Mark Langsdorf <mark.langsdorf@gmail.com>
Date: Wed Jul 25 11:45:20 2018 -0500
vehicle part descriptions: fix typos in engineering.json
which are the two most recent commits I’ve added. The weird long string of gibberish after commit is the commit ID, and you can use
git show $COMMIT_ID
to see the changes attached to any particular commit.
A bunch of commits are a branch - you’ve already created one, and each commit you make will be added to your working branch. You can change your working branch with
git checkout $BRANCH_NAME
which you might do when you’re working on two different sets of independent changes. For instance, that was the log from my more_veh_descriptions branch, but I’ve also got a blazemod_descriptions branch for some other changes I’ve made.
git push
sends your most recent set of commits up to your repository on github. You can then go to the C:DDA master repository on github and create a pull request (PR), which means you want the C:DDA maintainers to add your commits to the main project.
ie, this is my more_veh_descriptions branch on github:
https://github.com/mlangsdorf/Cataclysm-DDA/tree/more_veh_descriptions
and this is the PR to the main tree
and this is a PR that’s been merged into C:DDA
Anyway, I hope some of that helps. Feel free to ask more, or look up git tutorials on the web - there’s a lot of them, and they can go into more detail about what a commit is, what a branch is, and how pushing to a remote repository works.