Skip to main content

Cloning an Existing Git Repository

After installing the freshcopy of ubuntu 11.04, I need to clone my already existing
github repository to my local drive to start gitting. Following are the steps, I had done to Clone the Existing git repository and start Gitting.

1 . Generate SSH keys for the repository. I tried to use already existing key in the github repo but I end up with an error. So created a new keygen by


ravikumar@ravikumar-desktop:~$ssh-keygen -t rsa -C "XXXX@gmail.com"


2. Copy the Newly generated SSH key.


ravikumar@ravikumar-desktop:~$ cd .ssh
ravikumar@ravikumar-desktop:~/.ssh$ gedit id_rsa.pub 

copy the entire key.

3. Now Login to your Github account and Goto the Repository's administration and goto 'Deploy keys',  click Edit and paste the new key.

4.  Now Goto following repository's page and copy the url as highlighted below:
Github url 
 
5. Clone the repo to your Local drive:

ravikumar@ravikumar-desktop:~$ git clone git@github.com:XXXX/codehacks.git
 Cloning into codehacks...
 remote: Counting objects: 304, done.
 remote: Compressing objects: 100% (238/238), done.
 remote: Total 304 (delta 60), reused 256 (delta 49)
 Receiving objects: 100% (304/304), 3.83 MiB | 16 KiB/s, done.
 Resolving deltas: 100% (60/60), done.


6.Now start Gitting:


ravikumar@ravikumar-desktop:~$ cd codehacks
ravikumar@ravikumar-desktop:~/codehacks$ ls
ADS Readme.txt            Cobol Readme.txt             Ruby
Advanced Data Structures  C++ Readme.txt               Ruby Readme.txt
ALP                       DBMS                         Solve Euler
ALP_Readme.txt            Java                         Solve Euler Readme.txt
C++                       Java.txt                     VB6
C Codes                   My Package Works             VB6.txt
C Codes Readme.txt        My Package Works Readme.txt
Cobol                     Readme.txt
ravikumar@ravikumar-desktop:~/codehacks$ gedit Readme.txt
ravikumar@ravikumar-desktop:~/codehacks$ git init
Reinitialized existing Git repository in /home/ravikumar/codehacks/.git/
ravikumar@ravikumar-desktop:~/codehacks$ git add *
ravikumar@ravikumar-desktop:~/codehacks$ git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
# modified:   Readme.txt
#
ravikumar@ravikumar-desktop:~/codehacks$ git commit -m -a
[master 076e766] -a
 1 files changed, 1 insertions(+), 1 deletions(-)
ravikumar@ravikumar-desktop:~/codehacks$ git push origin master

Happy Gitting :)
Some Errors which I had Encountered During Git installation:
Permission denied (publickey):

ravikumar@ravikumar-desktop:~/.ssh$ ssh  git@github.com
Agent admitted failure to sign using the key.
Permission denied (publickey).

solved by

ravikumar@ravikumar-desktop:~/.ssh$ ssh-add ~/.ssh/id_rsa
Identity added: /home/ravikumar/.ssh/id_rsa (/home/ravikumar/.ssh/id_rsa)

Comments

Popular posts from this blog

Android Studio Ninja Tip: Custom try/catch code template

As an Android Studio user, you should be familiar with the “ surround-with try-catch” functionality. Surround with try-catch When you use Ctrl+Alt+T (Linux) / Cmd+Alt+T (Mac) shortcut, the built-in try-catch generator auto generates a call to the printStackTrace() method of class Exception in the catch block. After this, we manually add some code to log the exception. e.g., Log.e(TAG, “Oops! something gone wrong”, e); As a power user, you may have used some or all of the following built-in Live templates: Live Templates You can save yourself the pain of these 5-keystrokes or repetitive typing or copy pasting the code by becoming a Ninja who uses a custom built-in try-catch template. Steps for customization Step-1 : Go to Android Studio Preferences | Editor | File and Code Templates Step-2:  Select Code | Catch Statement Body Step-3:  Replace the existing template from: ${EXCEPTION}.printStackTrace(); with: Log.e(getClass().getSimpleName(),...

BSNL HUAWEI WLL Modem Installation

Hi everyone, Do u experience problem in connecting to Internet using BSNL WLL HUAWEI ETS 1201 from Ubuntu. Here is my Solution for it: Step 1 : Install Wvdial (a program that makes it easy to connect your Linux workstation to the Internet.). In Ubuntu there is a Dependency hell problem U need to download “Other Packages related to Wvdial” before installing Wvdial. I hope U will do it! After installation just check it by:   developer@ubuntu:~$ which wvdial     /usr/bin/wvdial When the above message is received then Your Wvdial installation is fine and we move to the next step Step 2 : Just run developer@ubuntu:~$sudo wvdialconf In my case I got the error as shown below: ttyS0<*1>: ATQ0 V1 E1 -- failed with 2400 baud, next try: 9600 baud ttyS0<*1>: ATQ0 V1 E1 -- failed with 9600 baud, next try: 115200 baud ttyS0<*1>: ATQ0 V1 E1 -- and failed too at 115200, giving up. Modem Port Scan<*1>: S1 S2 S3 Sorry, no modem was detected! Is ...

Manjaro XFCE Post Installation Tips and Tricks

It's nearly a year since my last post, a lot of things had happened in between, Placement preparation, couple of interviews, six month internship in Blackberry Platform at  Payoda Technologies   and finally completion of my studies. During this period a lot of distros had been released but I stayed with the stable Opensuse, but then I felt KDE version of opensuse is little bit heavy, which can be felt during both start-up and during normal day to day usage(say Eclipse+amarok+chrome) even with 4GB RAM and i3 Processor. I started my quest for "The best GNU/Linux OS" with distrowatch.com . Since I wanted a lighter distro but not certainly like Puppy/Tiny and no Ubuntu/Debian forks then by default I left with Arch. But the fear of  two earlier failed attempts to install Arch forced me to try arch fork than arch. Seeing  Manjaro   Linux description " Manjaro Linux is a desktop-oriented, user-friendly distribution based on Arch Linux " , I thoug...