Quantcast
Browsing latest articles
Browse All 35 View Live

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

Image may be NSFW.
Clik here to view.

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

This is from GitLab:Just follow the instructions:

View Article


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

As the title says "Best way", I think it's a good idea to consider thepatience 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 How do I safely merge a Git branch into master?

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 mastergit pullNo need to check out first; rebase does the...

View Article

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

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 (feature) branch on top of master. If there is a...

View Article


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

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 How do I safely merge a Git branch into master?

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 How do I safely merge a Git branch into master?

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 How do I safely merge a Git branch into master?

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

View Article

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

This is a very practical question, but all the answers above are not practical.Likegit checkout mastergit pull origin mastergit merge testgit push origin masterThis approach has two issues:It's unsafe,...

View Article


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

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 isgit checkout mastergit pullgit checkout...

View Article

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

How I would do thisgit checkout mastergit pull origin mastergit merge testgit push origin masterIf I have a local branch from a remote one, I don't feel comfortable with merging other branches than...

View Article


How do I safely 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 Jakub Holan for How do I safely merge a Git branch into master?

Disclaimer: I am a junoir in using git. This answer is based mainly on recommendations given to me by my senior colleagues. If the answer is flawed, please let me know, and I will adjust it.To expand...

View Article


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

git pull //will get the latest changesgit checkout //to checkout the required branchgit log //to check for the logs recently commitedgit checkout testgit log --since="last month"git pull origin...

View Article
Browsing latest articles
Browse All 35 View Live