##How it all Operates
I worked a path from creating an empty folder to a live repository,using Git Bash,powershell and SHH authentication insted of typing in the password each time i'm pushing aproject to github.
Where this is going
steps followed in each order?
Create a GitHub account
Set up a project folder
Generate an SSH key
Register the key with GitHub
Create a repo and link your local folder to it
Get a GitHub account
If you don't already have one, head to github.com and sign up — email and your password.
Set up a project folder
Open git bash and enter this commands:
cd Desktop
mkdir my-project
cd my-project
once you're inside your project add a sub folder of data or scripts by running this command:
mkdir data
Inside the the folder we add a READNE.md file by running this command:
touch README.md
Generate an SSH key
Open PowerShell as Administrator first, just to confirm Git is actually installed:
git --version
You'll see averion of the git you have installed if you don't install one before moving to the next step.
Then switch to Git bash and generate the key:
ssh-keygen -t ed25519 -C "your_email@example.com"
We get where to save it and prompted to set a passphrase,you can add a passphrase or skip it and while adding you won't see it add it will be added once you type.
Back to powershell as Administrator:
Get-Service -Name ssh-agent
Start-Service ssh-agent
On powershell close that admin window and open a regular PowerShell window. Add your key to the running agent:
ssh-add C:/Users/YOUR_USERNAME/.ssh/id_ed25519
Add SSH key to GitHub account
copy it manually from you git bash.
On GitHub, go to Settings → SSH and GPG keys → New SSH key. Give it a descriptive title (your PC name) leave the key type as Authentication Key, paste in what you copied and save.
Back in Git Bash, inside your project folder run this commands:
git init
git remote add origin git@github.com
git add .
git commit -m " "
Meaning of each command that helps push a project to gitHub:
git init turns the folder into a Git repository.
git add . adds everything in the current directory for the next commit.
git commit -m "..." saves it with the message described.
git push -u origin main sends your commits to GitHub and links your local
Top comments (0)