So I made my first commit to GitHub a year ago. It wasn't much, but the daily streak eventually helped me to REALLY get going.
Since then, I've
* made documentation and code changes to Trizbort
* made repositories for my 2012-2015 IFComp games
* also merged in my 2013 Spring Thing game with 2012
* created a miscellaneous files archive for all kinds of things
* copied over some of my old RPG map creation files
* made 1000+ changes
* started an almost 5 month + daily streak
This is a lot, and I can't call myself a GIT wizard. I just know the basic commands. In fact, I have a cheat sheet for some of them below the cut.
So why am I posting this to planet-if?
Because many people I know have questions. They wonder how to get started. They think it'll be impossible.
But I think the way to start is to say, okay, I want some sort of backup so my files don't get lost. I'll push story.ni to it. I don't care about anything else. Maybe I'll report an issue. And then build from there. That's how I did it. Just pushing trivial changes, maybe even starting with something silly like an EctoComp entry where I needed to clear up typos.
The drawback is that I've neglected bitbucket, which doesn't have that small nudge. But I've done well with modifying my current Spring Thing game as well as my possible IFComp 2016 game.
My cheat-sheet is below. I'm not worried about too much else. Clone, commit and push are all you need to know. I even forget the difference between clone and fetch--but the nice thing is, you can't ruin too much. So go ahead. Make a blank project. Poke around. Start with small changes. You might be happy and impressed what you've come up with.
To get a repository:
git clone https://github.com/andrewschultz/[name].git
git clone https://bitbucket.com/andrewschultz/[name].git
To change a message:
git commit --amend -m "save and undo bugs fixed, #18 closable"
(only if others not using it)
git push --force
git fetch https://github.com/JasonLautzenheiser/trizbort
git remote add origin https://email@example.com/andrewschultz/new-project.git
Create your first file, commit, and push
echo "Andrew Schultz" >> contributors.txt
git add contributors.txt
git commit -m "Initial commit with contributors"
git push -u origin master
git diff is a big command to see WHAT is changed--it's so useful to get rid of debug text and so forth.
git checkout -b altfix
git commit -m "#225 about: added basic stuff"
git push --set-upstream origin altfix
git checkout master
git checkout (unmodified file) reverts it.
git reset --hard will undo everything, which is really harsh.
To get rid of a tracked file or no longer track it:
git rm -r --cached .
git add .
git commit -m "fixed untracked files"
To keep up to date with the master branch:
git pull http://github.com/jasonlautzenheiser/trizbort