Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

resolve merge conflicts git

Merge conflicts usually occur when multiple developers work on the same code 
of a project or when they work with several development branches. 
Git merge warns the user about these conflicts.

Although most merge conflicts resolve automatically, there are cases when 
git merge cannot resolve an issue.

# Accept the local version. 
git checkout --ours <file name>
# Alternatively, to accept the local version for all conflicting files, use:
git merge --strategy-option ours

#  Accept the remote version
git checkout --theirs <file name>
# Accept the remote version for all conflicting files with:
git merge --strategy-option theirs
Comment

how to resolve conflict in git

This is very question because I am facing
with this issue all the time. Basically
conflict arises when more than one commit 
that has to be merged with some change in the
same place or same line of code. In this case
git will not be able to predict which change
to take. So my approach to fix this issue, 
I would stash my project to temporary memory 
and pull the project from github to working 
directory. I would fix the confict and
merge the project and than I would add,
commit and push it the updated version.


git stash        -- > take my project to temp memory
git pull         -- > pull the project from GitHub to working directory
						(my computer)
git stash pop    -- > take my project to my working directory,     
					fix the conflict and merge the project.
git add .
git commit –m “comment”
git push
Comment

git merge conflict resolve

$ git commit -m "Resolved merge conflict by incorporating both suggestions."
Comment

PREVIOUS NEXT
Code Example
Shell :: deletes lines including regex match 
Shell :: ubuntu 
Shell :: git clean local branches 
Shell :: clone all github repos 
Shell :: rm remote git 
Shell :: npm install webpack server 
Shell :: teams ubuntu 
Shell :: install dpkg 
Shell :: docker build requires exactly 1 argument 
Shell :: test ssh connection for github 
Shell :: reset git file 
Shell :: install crontab in linux 
Shell :: omni github 
Shell :: linux execute sh 
Shell :: bash here document example 
Shell :: microphone auto adjusting ubuntu 
Shell :: install solidity compiler command with version 
Shell :: should you use docker on linux 
Shell :: git pull new branch from remote 
Shell :: ubuntu what is my ip address 
Shell :: what is git rebase 
Shell :: command to open snap gui 
Shell :: ubuntu set deepin terminal as default 
Shell :: dockerfile from local image 
Shell :: chocolatey update yarn to particular version 
Shell :: ufw enable no disrupt 
Shell :: Unix and Linux System Commands 
Shell :: gh-pages-clean 
Shell :: Fixing Flutter ios build errors 
Shell :: remove inkscape 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =