- cd into the directory
- go to https://github.com/new and create a new repo. DO NOT check the initialize repo with README option.
- you will get a screen like
- run
git initto create an empty git repo. (it is empty because we need to add files to the git repo, it doesnt account for the files in the same folder automatically) - run
git add --allto add all files & folders in the current folder to git repo. rungit statusto see files added to git staging area - run
git commit -m "short message about what changes happen in this commit": note that a message is required by git. - add a remote (github repo) to your local git repo using command
git remote add origin git@github.com:user/repo.git - send your local git repo to github using
git push -u origin master: here origin is set to github by the prev command. master is the default branch. - open github.com/user/repo in browser to view the git repo on github. bahut likh diye. aage baad me
-
-
Save nezl/e06c98903d61968a1291 to your computer and use it in GitHub Desktop.
create a public-private key pair to authenticate with github over ssh.
run ssh-keygen -t rsa -C "yourmail@mail.com"
======================================
(you can skip this step)
see if you have ssh private key added to your current configuration using ssh-add -l
if the output is same as the one on github, youre good to go
verify your ssh access using the command :
ssh git@github.com
if the output is on the lines of "hi priya...we do not provide shell access", youre good to go. notice that in github ssh settings page, the concerned ssh key has a green dot checked against it, thus verifying your access to github over ssh.
now we configure settings for your local git:
git config --global user.name "Your Name": attaches your name to all commits which happen on your desktopgit config --global user.email "you@mail.com": attaches your email to all commits which happen on your desktopgit config --global core.editor nano: set commit editor to nano, the easiest command line text editor. usectrl+Xto save and exitgit config --global color.ui true: enable colors in git command line wherever applicable
NOTE: github provides two kinds of access: one over https using username & password authentication & another over ssh using public-private key pair for authentication

This article on adding a git repo to an existing folder is super helpful! I once struggled with this myself. It's great how it breaks down each step clearly. try the tridle game