Tuesday, February 11, 2014

Github for beginners - how to start your own repository - step by step

This is a brief article how to start your own github repository and push updates to it.

Powerful collaboration, code review, and code management for open source and private projects.

Create a new account and sign up at github

Create  a git repo - log in to github and create a new repo


then add README , licenses ....(check/uncheck the selection boxes):

Ona linux machine , make sure you have:
apt-get install git-core

Then in hte directory where you have your files and folders (the directory where the code that you would like to upload to github for sharing):

git init
git add <every single file/dir one by one>
git commit -a -m "First commit message - initial upload"
git remote add origin https://github.com/pevma/MyNewRepoName.git
git fetch origin
git rebase origin/master
git push -u origin master
NOTE: Make sure you change the name of your repository accordingly!!

When you are doing changes in the code directory on your machine/PC...to update the github repo:

git commit -a -m 'Some meaningful message !'
git push -u origin master

This is enough to get you gihubbing :) and most likely , the more you use it , the more you are going to like it. At least that is my case.

No comments:

Post a Comment