Why git is needed
-
Today you cannot survive as software engineer without knowledge of
git
git is Version Control System which stores your company's code at central place(central server)
From mid-90s to the mid-2000s Perforce era to Git (released 2005) demand to store code centrally exists will continue ever
Here we will look into steps which a software engineer should take once he joins a new organization and want to clone his company's 1st Project to get started with work
1. ssh keys
1a. Create your ssh public, pvt key pair
-
github/gitlab allows code to be cloned using ssh keys(Username, Password
is deprecated) , so you have to create your public, private
key(locally).
You can refer this document to create your public, Private key pair
Your public, pvt keys should be created inside C:\Users\your-user-name\.ssh
C:\Users\your-user-name\.ssh> dir
Directory of C:\Users\your-user-name\.ssh
16-11-2025 17:50 <DIR> .
13-02-2026 07:29 <DIR> ..
23-06-2025 09:00 464 id_ed25519
23-06-2025 09:00 98 id_ed25519.pub
1b. Add your public key to your github/gitlab account
-
Create your account on github/gitlab. We will refer gitlab(here).
Steps:
1. Sign up with your email Id, you will land on this page: https://gitlab.com/your-username/
2. Click on your Profile Picture on Right side > Preferences > SSH Keys > 3. Add New key
4. Open file(id_ed25519.pub) created in previous step and paste the content
- Title: your username
- Usage Type: Authentication & Signing
- Expiration Date: Never
- Add
2. Map ssh keys to your github/gitlab account
Create C:\Users\your-user-name\.ssh\config file
-
Once keys are created, these keys need to be mapped to your
github/gitlab username, this is done using config file
if file does not exist, create manually C:\Users\your-user-name\.ssh\config
Once file is created, add this entry into the file
> C:\Users\your-user-name\.ssh\config
Host myusername
HostName gitlab.com
User git
IdentityFile ~/.ssh/id_ed25519
IdentitiesOnly yes
Test ssh keys
-
Now you have mapped the ssh key to your gitlab account its time to test
the ssh keys.
Once you see the Welcome message you are all set for fork your company's upstream repository.
> ssh -T gitlab_myuser
Enter passphrase for key 'C:\Users\your-user-name\.ssh\id_ed25519@gitlab.com':
Welcome to GitLab, @user
3. Fork your company's upstream repo
-
Forking the upstream repository means creating a local copy for your
use
All you changes will land on your local fork, when you want to push on upstream you need to create a pull request.
Steps:
1. Go to your gitlab account
2. In search bar, search (Your Company Name), you will see "Company-Name:Project1". Click on that
3. you will land on this page "https://gitlab.com/Your-Company-Name/Project1"
4. Click Fork on right, this will create a local copy in your gitlab account.
It might take some time, code will appear under gitlab Projects.
4. Clone your forked code
-
Under
gitlab Projects you
can see 2 enteries
your-username / Project1 ... 1 //Clone this
your-company-name / Project1 ... 2
You have to clone 1st(ie your-username / Project1)
// This is your config entry
> C:\Users\your-user-name\.ssh\config
Host myusername
HostName gitlab.com
User git
IdentityFile ~/.ssh/id_ed25519
IdentitiesOnly yes
C:\>git clone git@gitlab.com:myusername/Project1.git
Cloning into 'Project1'...
Enter passphrase for key '/c/Users/<your username>/.ssh/your-user-name':
remote: Enumerating objects: 355, done.
remote: Counting objects: 100% (241/241), done.
remote: Compressing objects: 100% (213/213), done.
remote: Total 355 (delta 93), reused 97 (delta 6), pack-reused 114 (from 1)
Receiving objects: 100% (355/355), 1.00 MiB | 1.20 MiB/s, done.
Resolving deltas: 100% (106/106), done.
-
Now you are all set to make changes and create Pull Requests on Your
Company's Upstream Repo