Playing around with git.

Posted: December 3, 2012 in Uncategorized

Decided to play around with git to commit some of the Python Code I’ve been using to master ‘How to think like a Computer Scientist’ to github.

Basic Steps to commit your code to github are as follows.

1) Create an account on github.com (My username is vivekvc)

2) Generate an ssh key and upload the public key on github.

3) Create a project using git hub (my project name is python-code)

4) Create a directory using mkdir <directory_name> on your local machine.

5) Create or Copy the files you want to be add to git hub to the newly created directory

6) Issue the git init command inside the directory.

frodo@shire:~/python-code$ git init
Initialized empty Git repository in /home/frodo/python-code/.git/

7) Copy the git origin for your project from github.

frodo@shire:~/python-code$ git remote add origin git@github.com:vivekvc/python-code.git

8) issue the git add command

frodo@shire:~/python-code$ git add .

9) Commit your code with the -m option

frodo@shire:~/python-code$ git commit -m ‘Python Code’
[master (root-commit) 00521fd] Python Code
 14 files changed, 196 insertions(+)
 create mode 100644 computer-scientist/degree-radians.py
 create mode 100644 computer-scientist/degree-radians.py~
 create mode 100644 computer-scientist/expressions.py
 create mode 100644 computer-scientist/functions.py
 create mode 100644 computer-scientist/functions.py~
 create mode 100644 computer-scientist/functions1.py
 create mode 100644 computer-scientist/functions1.py~
 create mode 100644 computer-scientist/logtest.py
 create mode 100644 computer-scientist/math1.py
 create mode 100644 computer-scientist/math2.py
 create mode 100644 computer-scientist/print.py
 create mode 100644 computer-scientist/python.log
 create mode 100644 computer-scientist/variables_parameters_local.py
 create mode 100644 computer-scientist/variables_parameters_local.py~

11) Push your changes to github.

frodo@shire:~/python-code$ git push -u origin master
Counting objects: 17, done.
Compressing objects: 100% (13/13), done.
Writing objects: 100% (17/17), 1.97 KiB, done.
Total 17 (delta 5), reused 0 (delta 0)
To git@github.com:vivekvc/python-code.git
 * [new branch]      master -> master
Branch master set up to track remote branch master from origin.

There you go 🙂

 

 

Advertisements
Comments
  1. Fantastic goods from you, man. I’ve understand your stuff previous to and you’re
    just extremely wonderful. I really like what you’ve acquired here, certainly like what you’re saying
    and the way in which you say it. You make it enjoyable
    and you still take care of to keep it sensible.
    I cant wait to read much more from you. This is really
    a wonderful web site.

  2. I’m extremely impressed with your writing skills as well as with the layout on your weblog. Is this a paid theme or did you customize it yourself? Anyway keep up the nice quality writing, it’s rare to see a
    great blog like this one nowadays.

    • vivekvc says:

      Thanks Penske truck rental for your kind words of appreciation. The theme used is a free theme available on wordpress.com. I try to keep changing the themes when I get a little bored with one 🙂

  3. My partner and I stumbled over here from a different web address
    and thought I might as well check things out.

    I like what I see so now i’m following you. Look forward to looking at your web page yet again.

    • vivekvc says:

      Thanks Circumfrence of a circle for the kind words of appreciation. I’ll try me best to create more content enjoyable to many more. Please do keep in touch.

  4. Tommie says:

    Some people known as Nikon one V1 a conveyable DSLR the place
    you are able to just slip correct by way of your pocket but its shooting strength is
    identical as that of a DSLR. Some people will rely on
    transferring data between flash drives and their home computers, or sending what they wish to have printed to a proxy, such as Fed – Ex.
    There are a lot of options in mobile phones available on the market today.

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