Skip to content

GitHub methodology

nilnullzip edited this page Jul 4, 2011 · 9 revisions

First, make sure to set up Git and your SSH keys as directed here.

http://help.github.com/mac-set-up-git/ http://help.github.com/win-set-up-git/

One thing I'm fuzzy on is why they are recommending that you replace your old SSH keys. You might still need those for other purposes. I didn't do that and just used my existing keys for GitHub. Also, you will not need any SSH keys if you will be using the GitHub Mac Client.

Please don't create a new StalkerBot repository or fork the nilnullzip StalkerBot repository or create any branches (at least for now.) We are going to keep it simple and follow the workflow implemented by the Mac GitHub client, which you can read about and download here:

http://mac.github.com/

The Git workflow

The basic workflow which we will follow is:

Initialize your repository:

  1. CLONE the repository from GitHub to your system. (Mac client supports only one clone per system.)

Private development:
2) Make changes to code.
3) COMMIT your changes to your local repository.
4) Go back to 2) and repeat as necessary.

Publish your code:
5) PULL the GitHub repository to get everyone else's changes
6) Test your changes with everyone else's changes to make sure everything works
7) PUSH/SYNC your repository to the GitHub repository
8) go back to 2) and repeat as necessary.

Using the Mac Client

All these steps can be done using the Mac client. Please use Sync for step 7) instead of Push menu item.

Using Windows client

Not sure what the Window's client looks like, but presumably similar. Follow the command line work flow below:

Using the command line client

For command line, use the following git commands:

  1. git clone git@github.com:nilnullzip/StalkerBot.git
  2. git add <filename>
    git commit [<filename>|-a]
  3. git pull --rebase (Make sure to include --rebase option!)
  4. git push

Note that there should be no need to give additional arguments to the push and pull --rebase commands. In the documentation they show origin and master arguments. I don't think we need to worry about that at all with this simplified workflow.

Merge conflicts will be reported and will result in files with annotations that need to be hand edited. Note that Emacs understands Git natively which allows you to Ediff (I love Ediff!) your code vs the repository versions.

Clone this wiki locally