Saturday, April 20, 2013

Committing Your Project on GitHub

I had a custom png image I/O program that I've used multiple times to process images and even to visualize data in a highly customized manner and I wanted to share it on GitHub.

Here's a summary of steps that I followed:

1. On GitHub website, create a new GitHub account with your user name. You may use your firstname-lastname (note the hyphen) as your user name; for sake of privacy, let your email id be firstname-lastname@server.fake and choose a password as instructed.

2. Click on "New repository" button and create a new repository with name repositoryName. Make sure that you select "Initialize this repository with a README" option.

3. Install and configure git
$ sudo yum install git-core
$ git config --global user.name "firstname-lastname"
$ git config --global user.email firstname-lastname@server.fake
$ git config --global credential.helper cache

$ git config --global credential.helper 'cache --timeout=3600'

4. Checkout the newly created repository from GitHub
$ git clone https://github.com/firstname-lastname/repositoryName.git

As you would expect, a folder with the name of repository (repositoryName) will be created having just the README file in it.

5. Create more files in this folder and add the new files to the repository.
$ git add file1
$ git add file2

6. Commit the changes.
$ git commit -m 'initial version'

7. Commit the changes to GitHub website also.
$ git push origin master

That's it!

Note: You can download my committed program from this link: https://github.com/ajay-anand/png

No comments:

Post a Comment