Wednesday, November 10, 2021

Bit-bucket pull request conflict resolve

 #1. resolving the conflict in bit bucket pull request

git checkout commit-id

eg:

$git branch -a

* (HEAD detached from eb9e6ce)

  master

  test

  remotes/origin/HEAD -> origin/master

  remotes/origin/master

  remotes/origin/test


#2. merge the changes from master to the detached HEAD,so both changes will be there if conflict

git merge remotes/origin/master

HEAD>>>>

<<<<<<


#3. resolve the conflit and commit it ....

git add files

git commit -m "conflict resolved" # status shows (HEAD -> test)


#4. Pushing the commit to the remote and switch to the target branch and pull

git push origin HEAD:refs/heads/test

git checkout <branch-name>

git pull #status shows conflict fixed (HEAD -> test, origin/test)


#5. In bit bucket the master changes will be sync to the test branch