Search This Blog

Sunday, February 10, 2013

My git recipes

  1. To download the repository to your local host
  2. $ git clone https://github.com/rtomaszewski/#repo.git#
    

    Or you can upload a public SSH key to your github account as described here https://help.github.com/articles/generating-ssh-keys and then clone using SSH method.

    $ git clone git@github.com:rtomaszewski/#repo.git#
    

  3. To commit and upload the source back to repository
  4. $ cd #repo#
    $ git add new-file.py
    $ git commit new-file.py -m 'init'
    $ git push origin master

  5. To update your local repository with the master
  6. $ cd #repo#
    $ git pull
    $ git pull origin master

  7. List config settings
  8. $ cd #repo#
    $ git config -l 

  9. Rename a file
  10. $ cd #repo#
    $ git mv README README.md
    $ git commit -m "renamed"
    $ git push origin master
    
References
  1. http://stackoverflow.com/questions/5989893/github-how-to-checkout-my-own-repository
  2. http://superuser.com/questions/199507/how-do-i-ensure-git-doesnt-ask-me-for-my-github-username-and-password
  3. https://help.github.com/articles/set-up-git#password-caching

No comments:

Post a Comment