This article began with the intention of demonstrating that Git and GitHub are not the same thing.
Linux has revolutionized using only the command line, as evidenced by the fact that the user interface we have today as a default was only a feature available to administrators a decade ago and scarcely employed.
Mastering the command line is one of the most powerful things you can do.
After installing Git
Run the following commands.
git config --global user.name "FIRST_NAME LAST_NAME"
git config --global user.email "MY_NAME@example.com"
This step varies from repo hoster to another, but it is mostly the same. You must generate a public key from your local terminal and save it to your repository hoster.
Run the following commands.
ssh-keygen -t rsa -b 2048 -C "email@example.com"
Click Enter instantly => Type parraphrase Twice => Done!
Now copy the Pk using this command(windows):
- cat ~/.ssh/id_ed25519.pub | clip
Perfect, GO to your repo hoster and paste the SSH key, along with a descriptive name! For further details, you can consult the excellent GitLab documentation.
Note For an improved algorithm you can run the following commands then copy again.
ssh-keygen -o -f ~/.ssh/id_rsa
ssh-keygen -o -t rsa -b 4096 -C "email@example.com"
I've included a brief video describing the Git/GitHub workflow.
Please read the information provided below to make the most of it.
%[https://www.youtube.com/watch?v=qwO_X6h8rVM]
mkdir <FolderName>
: Stands for Make a Directory, create a new folder.cd <FolderName>
: Move to the below folder.pwd
: Where am i? Print the working directory.ls
: What is in the current folder?.touch <filename>
: Create a new file.
Git is the most popular version control system. It keeps track of the changes you create to files so you can go back in time if required. It also aids collaborative efforts by enabling various people's changes to be merged into a particular source code.
It's simply a location where you keep and store your git belongings locally. Allowing the creation of a history over time.
git init
: Initizalize your local git repository.git add <filename>
: add the files/changes to the git repositorygit add .
: Add all of the files and changes in the directory to the git repogit commit -m "Your amazing message here"
: Before pushing, commit changes.git remote add origin <URL from your repository's hosting service>
: Connect your local git repository to a remote hosting repository such as github, gitlab, or any other.git push -u origin <ur branch name>
Go ahead and push your great stuff!
- Navigate to the desired directory using
cd
- Once you've arrived, make a project folder with
mkdir
- Transmit to the new project using
cd
- Create the files you want once you are there by using
touch
code .
to edit your work in VS Code, save it, and then return to the terminal- Create your git repository using
git init
- Add your current files to the git repository
git add .
- It's time to commit your modifications by using the
git commit
- Connect your git repository to the external repository
git remote
Push
and observe the magic.
Big things happen of a simple start. Get your workflow on, create your inspiration, and show it off.
Bonus, each project should include a README file as a best practice.