Quantcast
Channel: How do I safely merge a Git branch into master? - Stack Overflow
Browsing all 35 articles
Browse latest View live

Answer by Robin Wieruch for What is the best (and safest) way to merge a Git...

Old thread, but I haven't found my way of doing it. It might be valuable for someone who works with rebase and wants to merge all the commits from a branch on top of master. If there is a conflict one...

View Article



Answer by user776686 for What is the best (and safest) way to merge a Git...

I would use the rebase method. Mostly because it perfectly reflects your case semantically, ie. what you want to do is to refresh the state of your current branch and "pretend" as if it was based on...

View Article

Answer by Martin Thoma for What is the best (and safest) way to merge a Git...

I would first make the to-be-merged branch as clean as possible. Run your tests, make sure the state is as you want it. Clean up the new commits by git squash. Besides KingCrunches answer, I suggest to...

View Article

Answer by djheru for What is the best (and safest) way to merge a Git branch...

This is the workflow that I use at my job with the team. The scenario is as you described. First, when I'm done working on test I rebase with master to pull in whatever has been added to master during...

View Article

Answer by Vinay Sikarwar for What is the best (and safest) way to merge a Git...

git checkout master git pull origin master # Merge branch test into master git merge test After merging, if the file is changed, then when you merge it will through error of "Resolve Conflict" So then...

View Article


Answer by John Yin for What is the best (and safest) way to merge a Git...

This is a very practical question, but all the answers above are not practical. Like git checkout master git pull origin master git merge test git push origin master This approach has two issues: It's...

View Article

Answer by raylu for What is the best (and safest) way to merge a Git branch...

Neither a rebase nor a merge should overwrite anyone's changes (unless you choose to do so when resolving a conflict). The usual approach while developing is git checkout master git pull git checkout...

View Article

Answer by KingCrunch for What is the best (and safest) way to merge a Git...

How I would do this git checkout master git pull origin master git merge test git push origin master If I have a local branch from a remote one, I don't feel comfortable with merging other branches...

View Article


What is the best (and safest) way to merge a Git branch into master?

A new branch from master is created, we call it test. There are several developers who either commit to master or create other branches and later merge into master. Let's say work on test is taking...

View Article


Answer by Julian for What is the best (and safest) way to merge a Git branch...

As the title says "Best way", I think it's a good idea to consider the patience merge strategy. From: https://git-scm.com/docs/merge-strategiesWith this option, 'merge-recursive' spends a little extra...

View Article

Answer by Masoud Mokhtari for What is the best (and safest) way to merge a...

You have to have the branch checked out to pull, since pulling means merging into master, and you need a work tree to merge in.git checkout master git pull No need to check out first; rebase does the...

View Article

Image may be NSFW.
Clik here to view.

Answer by shdr for What is the best (and safest) way to merge a Git branch...

This is from GitLab: Just follow the instructions:

View Article

Answer by cgnorthcutt for What is the best (and safest) way to merge a Git...

@KingCrunch's answer should work in many cases. One issue that can arise is you may be on a different machine that needs to pull the latest from test. So, I recommend pulling test first. The revision...

View Article


Answer by omkar for What is the best (and safest) way to merge a Git branch...

I'll answer as per develop and feature branches,if you're on feature branch and need to update it with develop use below commands:git checkout developgit pullgit checkout feature/xyzgit merge...

View Article

Answer by mchavezi for What is the best (and safest) way to merge a Git...

I always get merge conflicts when doing just git merge feature-branch. This seems to work for me:git checkout -b feature-branchDo a bunch of code changes...git merge -s ours master git checkout...

View Article


Answer by rhavelka for What is the best (and safest) way to merge a Git...

There are a lot of good answers here already. I am just adding the steps that I do.git fetch -pgit checkout mastergit rebase origin/mastergit checkout testgit rebase masterExplanationgit fetch -p will...

View Article

Answer by rhavelka for How do I safely merge a Git branch into master?

There are a lot of good answers here already. I am just adding the steps that I do.git fetch -pgit checkout mastergit rebase origin/mastergit checkout testgit rebase masterExplanationgit fetch -p will...

View Article


Answer by mchavezi for How do I safely merge a Git branch into master?

I always get merge conflicts when doing just git merge feature-branch. This seems to work for me:git checkout -b feature-branchDo a bunch of code changes...git merge -s ours master git checkout...

View Article

Answer by omkar for How do I safely merge a Git branch into master?

I'll answer as per develop and feature branches,if you're on feature branch and need to update it with develop use the below commands:git checkout developgit pullgit checkout feature/xyzgit merge...

View Article

Answer by cgnorthcutt for How do I safely merge a Git branch into master?

@KingCrunch's answer should work in many cases. One issue that can arise is you may be on a different machine that needs to pull the latest from test. So, I recommend pulling test first. The revision...

View Article
Browsing all 35 articles
Browse latest View live




Latest Images