Basic Commands In Git

Search for a command to run...

No comments yet. Be the first to comment.
Learn the fundamental concept of Git and GitHub and start contributing in Open Source world and Easy Development Experience.
So after learning the basic commands of git in our previous section, let's see Git in action. If you already have a project to track your files then you can skip this section and if not then continue. Initializing a Repository from Non-existing Dire...
You've done it. I've done it. We've all done it.

Your AI Agent Has Amnesia. ByteRover Fixes It — Without Vectors Let's see how to built a customer support agent that remembers everything — using plain markdown files, BM25 search, zero embeddings, a

My GenAI cohort kicked off today, and what a first day! Right away we were reminded that AI isn’t magic — at its core, models like Generative Pretrained Transformers (GPT) are doing one simple thing:

Hello Folks👋, I Recently got Graduated🎓 in 2020, yep in the Pandemic. We all hit very hard by this Corona Pandemic and we all got stuck at home for very long. We all realize the Importance of Socializing, Fitness (Physically as well Mentally), Diet...

So after learning the basic commands of git in our previous section, let's see Git in action. If you already have a project to track your files then you can skip this section and if not then continue. Initializing a Repository from Non-existing Dire...

In the previous section we have installed Git on our system. In this section, we will see some basic commands in Git. we will use these commands in the next section, here our aim is to know what are the commands in git and what is their usage.
Utility: To initialize a git repository for a new or existing project.
How to: git init in the root of your project directory.
Example:
git init
Utility: To copy a git repository from a remote source, it also sets the remote to original source so that you can pull again.
How to: git clone <:git url:>
Example:
git clone https://github.com/altafshaikh/Friends-The-Social-Network.git
Utility: To check the status of files you've changed in your working directory, i.e, what all has changed since your last commit.
How to: git status in your working directory. lists out all the files that have been changed.
Example:
git status
Utility: adds changes to stage/index in your working directory.
How to:
git add .
Utility: To save changes to the local repository safely. Commit takes a snapshot of the project and treats it as a version.
How to:
git commit -m "sweet little commit message"
Utility: It is used to transfer or push the commit, which is made on a local branch in your computer to a remote repository
How to: git push <:remote:> <:branch:>
Example:
git push origin master
Utility: It is used to fetch and download content from a remote repository and immediately update the local repository to match that content.
How to: git pull <:remote:> <:branch:>
Example:
git pull origin master
Utility: To check the version if the git is installed
How to:
git --version
Utility: To check what remote/source you have or add a new remote.
How to: git remote to check and list. And git remote add <:remote_url:> to add a remote.
Example:
git remote add https://github.com/altafshaikh/Friends-The-Social-Network.git
Congratulations!! We have learned basic commands of Git and now we are ready to use them and see Git in action, in our next section.