In this guide I am going to upload my existing project from my linux machine's terminal to github.
Initiate Git
Open terminal and navigate to your project's directory.
git init
Configure your username and email
git config --global user.name "your_github_username"
git config --global user.email "your_github_email"
git config -l
Create an empty repository on Github
Copy the https link of that repository
Add remote origin
git remote add origin https://github.com/username/repo-name.git
Add all files into stage and commit with commit message
git add .
git commit -m "Initial Commit"
Now push to github
git push origin master
Generate Access Token
Before entering your password Go to Settings
> Developer settings
> Personal access tokens
> Tokens (Classic)
> Generate new token (classic)
> Mark repo
and add a note
> Hit Generate Token
> Copy the Token
Paste your token into password
Cache the record locally to remember the token:
git config --global credential.helper cache
Verify
git pull -v
Source: StackOverflow
Top comments (0)