-3

I am working on my branch and do commits daily. After committing to my branch then I push to the remote server master branch. Due to commit and not pushing to the remote branch, when I am trying to pull or push, I am getting conflicts.

How can I revert my commit from my branch so that I can pull all the latest changes from the remote branch and along with that while reverting the commit. My changes should not be gone from my workspace files.

Richard Hamilton
  • 25,478
  • 10
  • 60
  • 87
AndroidGuy
  • 21
  • 5

1 Answers1

0

... do commits daily

You can ease the pain by breaking down your work into multiple commits per day. When you code passes the necessary tests, an doesn't break anything, you push it upstream.

When this results in a conflict, fetch the upstream code and rebase your code as a delta on top of upstream. This gets easier when you and your teammates push more and smaller commits per day.

There is a catch, though. The entire team must understand the implications. Using a rebase workflow assumes that upstream is perfect, and you should strive for good and clean code with every commit.

If you are maintaining multiple releases of the same product, without continuous delivery, you may need more complex workflows.

Not knowing your situation, I present advocates with good reasons for and against rebasing:

Pro:

http://kensheedlo.com/essays/why-you-should-use-a-rebase-workflow/

Con:

Git: continuous integration without rebase chaos

Community
  • 1
  • 1
Henk Langeveld
  • 8,088
  • 1
  • 43
  • 57