Introduction.
First understanding the difference between git and GitHub. understanding how they relate and its functions.
Procedure
step 1: Downloading Git and sign up for GitHub account
use recommended setup and follow instruction given to install depending on the operating system on your computer.
Step 2: Configurations of Git
Tell git who you are and make sure it knows you.
Tell git your name and email by using the following commands;
-
git config --global user.name "Your Name"2.git config --global user. Email "you@example.com"
step 3: Generating SSH key
The ssh key will be used to link your Git and GitHub.
when running the command it will generate two keys; private and public.
public key is used to pair files.
command used is;
ssh-keygen -t ed25519 -C "you@example.com"
step 4: Adding the public ssh key to GitHub
Identify your public SSH key from your Git and copy it.
Open you GitHub and go to settings.
Click on the _SSH and GPG keys and add new SSH key.
Fill the tittle with name and paste your key.
Add the key and verify your using Gmail account.
step 5: create local folder from your computer with data
Create folder from your file explorer with data.
Name your folder.
Go to git and use
lscommand to list files name to ensure the created file name is edited.
Step 6: Git repository
Use
git commit -m "_your file name_command to turn the folder to git repository so that you can push to GitHub.
Step 7: pushing the file to GitHub
Add origin to match your GitHub account and the file using
git remote add origin git@github.com:" _your GitHub username and your file name_Since we created SSH key my git and GitHub are secure and connected.
Specify the folder and make it default before pushing by this command;
git branchUse;
git push -uto push your folder and put the passphrase if needed.Refresh your GitHub page and confirm the uploaded files.
Things to note
- Never share your private SSH key
- Always your directories where the files were created
Conclusion.
GitHub is a social network used to upload files and projects from your local computer using git. you can access your project or make it public for people to access. understand each step to make it easier and make it a routine.
Top comments (0)