At first create a repo from your github account
Now head back to the folder you want to push to github. It'll look something like this in terminal ~/foldername$
. Now Type and run
git init
This command will create a hidden folder .git
Head back to terminal and type
git add .
Remember to put the (dot). This will make all your file in that folder to be committed.
At this point you have to configure your name and email to run commit command.
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
Replace Your Name and email and run the commands separately.
Now you are ready to be committed
git commit -m "Your Commit Message"
Head back to browser and go inside your newly created repo again. You'll find a link like this pattern https://github.com/username/repository-name.git
If you don't find tap on Clone or download
and copy the link. Make sure 'https' is selected not 'ssl'
In terminal type
git remote add origin https://github.com/username/repository-name.git
Then run
git push -u origin master
Now Put your github username and password
Top comments (0)