-
Notifications
You must be signed in to change notification settings - Fork 31
Software Tutorial 03: Setting Up Your Development Environment
For developing the code, you'll want to make an account on GitHub if you haven't already. Create an account and register an email with the account (this is how GitHub maps your commits to your identity).
Setup your Git configuration to include your name and email.
git config --global user.name "Your Name Here" git config --global user.email "Your Email Here"
The email should match the one you told GitHub. You can also modify the text editor for Git with the following.
To use vim, a powerful editor with a high learning curve
git config --global core.editor vim
To use emacs, another powerful editor with less of a learning curve, but takes longer to load
git config --global core.editor emacs
To use nano, a simple text editor with almost no learning curve
git config --global core.editor nano
For those new to console text editors, nano is the best. It's highly suggested to learn how to use emacs or vim (or learn how to use both). On Ubuntu, nano is installed by default. You'll need to install vim and emacs with apt-get.
To setup color with git, you can set the option ui.color.
git config --global ui.color auto
To modify the global config in a text editor, you can use the -e option as such.
git config --global -e
This will open up a text editor with the global config file. At anytime, you can lookup various options for git with "git help config".
After you setup your GitHub account, you'll want to setup an SSH key and give the public key portion to GitHub (this will automatically authenticate your computer instead of having to type your password). To do that, follow these instructions.
When developing, you don't make modifications to the main repository. Push the "Fork" button in the top-right corner on the main project page or you can fork it from here.
You'll want to change your local repository to track this branch instead. Run the following commands.
git remote rename origin upstream git remote add origin [email protected]:youraccount/tortuga.git
By doing this, you can pull new changes from the upstream repository and you will push to your own repository by default.
git fetch upstream git merge upstream/master
Git has a convenience command to do exactly this.
git pull upstream
It's useful to know how to do both, because sometimes you don't want to run that merge command, but you want to run something else.
After committing a change, you can upload it using the "push" command.
git push origin master
You can then issue a pull request to get your change merged into the main repository.