** Why do we need git first? **
To connect all team members in one place, we use git, which makes it easier for developers to share code.
The main thing is that it is used to track our daily progress from day one, making it more consistent.
Version control is one of the reasons why most people choose
git
Figure 1 will help you understand version control.
Code Backup:- Your code is stored both locally and remotely(gitlab or any version control )so it's safe
What is git ?
-> Git is an open-source tool that helps us track changes in our
file, can work with teammates on the same project, and store
work histories.
*How to push and pull code between local and remote repositories *
First, create an account in GitLab or GitHub, but we are going to
Use GitLab.After creating the GitLab account, create a project or repository
In Gitlab
- Click new project
- Create a blank project
- Now your repository has been created successfully
NOTE:-After going to the code box, copy the clone with the HTTPS link.
------NOW THE REMOTE REPOSITORY HAS BEEN CREATED SUCCESSFULLY--------
NOW WE CAN MOVE TO LOCAL REPOSITORY
- Create a folder in the local, which is nothing but a normal folder creation
Now right-click the folder --> NEXT open in terminal
Type in the terminal --> git clone(---like that you copied from
remote repository --> press enter
Note:- ctrl+v will not work in the terminal, so paste the link
manually
Now open that folder, you will see there will be a new folder by
by the name which you have created in the remote repository, if
You click that folder, and in that, you will see a README.md file
If it is showing that you have cloned the repository successfullyFor pushing a file or folder from the local to the remote
repository for doing this, create a file in the local repository
Now right-click --> open in terminal
Type git status
Now, change that folder location to the cloned folder for that type
cd folder name
- Now type git status
- Type git add (file name ) --> press enter
- Commit the file is just a message before pushing to the repository Type:- git commit --m "What message you want to pass " press enter
- PUSHING THE FILE TO THE REPOSITORY Type :- git push
--> After that, it will ask for your username and password
--> If you have not set the user name and password, follow
the steps
--> Go to the start, type terminal
--->git config --global user.name "Your Name"
--->git config --global user.email "youremail@example.com"
---> change your-name and your email id
- Now go to GitLab and see that you will find the new file -->Before that, reload the GitLab page

This guide is super helpful for beginners! I remember struggling with my first push/pull workflow especially figuring out where to paste the clone link and how commits actually work. The step-by-step format makes it easy to follow, and I love the reminder that most Git problems can be solved with
git status
. Thanks for making this so clear!Thank you 😊
Well explained!