#FirstSteps: Most used Git Commands and concepts

Git offers a very wide variety of commands but here are the ones which are used on almost daily basis. This article is draft stage and targets beginners and is in process of expansion. If you are looking for advanced concepts then you are free to skip this article. Please leave your feedback if any.

Vaibhav Pandey
1 min readJan 16, 2021

1. Git init

It initializes a git repo on your local.

2. Git Add .

Adds files in your git repo to staging i.e. ready for check-in/commit to branch.

3. Git Commit -m “my Git commit comment”

Commits your code to the branch.

4. Git Push

Pushes your code to remote repo for online code collaboration.

Please note that this following commands will be used in combination very frequently to update your code to the local and remote repos:

git add .

git commit -m “updating code to the repo”

git push

5. Git Remote

Shows your remote repo locations configuration.

6. Git branch “branchname”

Creates a git branch.

7. Git Checkout “branchname”

Checks out your branch for changes and lets you start working with it, you can also use this command to create a new branch .

If you come from TFS background you should note that you checkout branches while working wiht Git repos where as in TFS you checkout files.

8. Git Merge

Merges specified branch to a target branch.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Vaibhav Pandey
Vaibhav Pandey

Written by Vaibhav Pandey

https://vaibhavpandey.co.uk, 9x Azure Certs Masters Degree in AI 2023, PG Diploma in AI 2022, Desertation in Cancer Prediction, Builds with AI

No responses yet