Sparkles

that were shone when I got tempered!

Adding a local project to the GITHUB

leave a comment »

1. Install GIT in Linux

sudo apt-get install git

or Synaptic Package Manager > git.

 

2. Create a repository in github (eg : CamelInAction)

repo-create

 

3.cd to the local project directory. (cd /rezsystem/workspace/CamelInAction)

 

4. Initialize the local project directory as a Git local repository.

git init

 

5. Add the git related files in to your new local repository. This stages them for the first commit.

git add .

6. Commit the files that you’ve staged in your local repository. Here, this will commit the tracked changes and prepares them to be pushed to a remote repository.

git commit -m 'First commit'

In this case, you may get a below like warning.

*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'namal@namal.(none)')

In this case, run the config commands as below.

git config --global user.email "namal@yahoo.com"
git config --global user.name "namalfernandolk"

 

7. Copy the remote repository URL.(GitHub repository, in the right sidebar)

copy-remote-repository-url

 

8. In Terminal, add the URL for the remote repository where your local repository will be pushed.
– Sets the new remote

git remote add origin https://github.com/namalfernandolk/CamelInAction.git

– Verifies the new remote URL

git remote -v

9. Push the changes in your local repository to GitHub. Here, it will pushes the changes in your local repository up to the remote repository you specified as the origin.

git push -u origin master

Here, In this step if you are getting 407 error.(eg : error: The requested URL returned error: 407 while accessing https://github.com/namalfernandolk/CamelInAction.git/info/refs
), add the proxy authentication details as (proxy = http://username:passwd@your-proxy-ip:your-proxy-port) to the git conf file. This will be the /rezsystem/workspace/CamelInAction/.git/conf file or .gitconfig file that is located in your $HOME folder.

Reference :
Advertisements

Written by Namal Fernando

June 30, 2014 at 8:45 am

Posted in GIT

Tagged with ,

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

Ruth's Reflections

Contemplations from quakey quirky Christchurch

TED Blog

The TED Blog shares interesting news about TED, TED Talks video, the TED Prize and more.

Ziplok

Learn and discover simple things

Meihta Dwiguna Saputra's Knowledge Base

~In learning you will teach and in teaching you will (re)learn~

The Java Blog

Thoughts, tips and tricks about the Java programming language

Sparkles

that were shone when I got tempered!

%d bloggers like this: