Software Engineer : How to use git commands properly

Shrirang Pinjarkar
2 min readJan 16, 2021

--

As a software engineer, it is necessary to know how to use git. There are always tools or extensions to resolve merge conflicts or push code to repository before you raise Pull Request.

But still I love to use git commands.
If you follow the steps below, you can easily solve merge conflicts.
Lets say you are on your feature branch and you are trying to pull code from dev branch.

1. git pull — all

If more than one developer are working on the same task, before you raise PR it is recommended to pull all latest changes to your local feature branch.

2. git commit -m “feature added”

Now you have the latest changes of feature branch, you can commit your changes and save on your local feature branch.

3. git pull origin dev

Above command will take latest changes from dev branch to your local feature branch.

4. git status

Lets check if there is any merge conflicts inside your feature branch.
If there is, solve merge conflicts and test your code again. It is highly recommended to write test cases (TDD) for your code so that you can easily test your code anytime in future. This will reduce your time later if the later again more changes are required to your code after code review.

5. git commit -m “dev and feature branch merged”

Now save your changes to local feature branch.

6. git push .

Push your local feature branch code to repository.

Thanks for reading. Hope you like it. Follow me on linkedin https://www.linkedin.com/in/shrirang-pinjarkar-3a1b73aa

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

--

--

Shrirang Pinjarkar
Shrirang Pinjarkar

Written by Shrirang Pinjarkar

An Independent Self Motivated Programmer who loves to solve technical and logical challenges. Love Data Structure & Algorithms Problems, Mathematics.

No responses yet

Write a response