Git

Well, too much of free time at hand, and I decided to set up a git profile of my own.

Here is the procedure which i followed to upload the first ‘test ‘ repository. Note: these procedures are after making an account and cover uploading a project/files using an Ubuntu 13.10 operating system

Download and install:

$sudo apt-get install git

Make a test folder/go to the folder you want to add. I would be using the name ‘test’ for this folder.  You also need to make a repository in your github account.

$mkdir test

$cd test

$git init

##^sets up necessary Git files

$touch readme.txt

$git add readme.txt

##^adds readme.txt to the list of file to be committed

$git commit -m ‘first commit’

##^commits the file, and adds the message: first commit

At this stage, i got the following message. Most probably because it was my first time.:

##

Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:

git config –global user.name “Your Name”
git config –global user.email you@example.com
##

$git config –global user.name “MyUsername”

$git config –global user.email myemail@gmail.com

$git remote add origin https://github.com/MyUsername/test.git

$git push origin master

Username for ‘http://github.com’: ChthonicCrusader
Password for ‘http://ChthonicCrusader@github.com’:

###I encountered the following error:

error: failed to push some refs to ‘http://github.com/ChthonicCrusader/test.git’
hint: Updates were rejected because the tip of your current branch is behind..

This can be corrected by typing in the following commands:

$ git pull –rebase origin maste

$git push origin master

Enter your username and password.

You can now check on your github profile that files have been added and changes made.

For more details you may refer to these links too:
https://help.github.com/articles/create-a-repo

http://stackoverflow.com/questions/14827930/how-do-i-resolve-a-github-message-that-says-the-tip-of-my-current-branch-is-behi

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s