Thursday, 7 August 2014

Working with your github repository via Linux or putty

Login to your github account and create new repository with

Go to the folder where you like to get the repository copy in your local system
e.g: cd /media/rajiv/D A T A/Learning/

git clone /path/to/repository
like in my case
git clone
means git clone<yourUsername>/<yourRepositoryName>/

You will get whatever in the repository till now
Move into the new directory with cd quizmaster/

Copy your new file in this directory
go with
git add <filename> or
git add *
to add all files

Now commit your files with
git commit -m "Commit message"

Now push your changes to repository on the github server
git push origin master

It will ask for username and password so be ready with both things:
Username for '': <yourUsername>
Password for 'https://<yourUsername>': <your password >

And that all. you can check over github account your files added there.

Working with Github for next push of updating file over github again

Now you have to set your non-readonly url to push your local changed file again

git remote set-url origin
means git remote set-url origin

git remote add origin
means git remote add origin

However you can add username and email in the config with
git config --global "YourUsername"
git config --global "YourEmail"

You can check your all set values in config with
git config --list

Lastly you have to write
git push
to add all code in your local commit to the github
it will ask for username and password

No comments :

Post a Comment