Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

124
Visualizações
GIT commits from branch to one

I have a problem with one branch on git. I have 11 changes in that branch and it's real mess with them, but there are other commits in development as well. Everything works fine, but we are working more people on this project. So what I need to do is, take every commit from this branch and commit them into a one in a same branch.

My branch name is update/user-section.

I watched a lot of videos and other posts here, but nothing solved my problem.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

So, you want to merge your changes from your branch into another. The first thing you probably want to do is make sure your branch has the target branches changes, to reduce conflicts when your merge code.

Start from the 'target' branch (where you will eventually merge your code)

git checkout targetBranchName
git pull

Then rebase those changes into your 'source' branch (in your case update/user-section)

git checkout update/user-section
git rebase --interactive targetBranchName

If there are conflicts, you will have to resolve them and follow the instructions to continue. Once you have no conflicts, you'll get a commit message outlining all the changes you are bringing in. To accept that commit message type :q and hit enter.

Once you have those changes from the target integrated, you now want to merge your updated branch back into the 'target' branch. This is where your changes become integrated.

git checkout targetBranchName
git merge --squash update/user-section

If you add the --squash flag to the merge command, it will bring in all of your code as a single commit. Without it, it will retain all of your original commits and their messages. Using --squash is usually preferred here, as it makes other's updates easier.

From here your code is now in your local copy of the target branch. Run git status to see if you need to add the changes, commit and push so that other's will now have access to your code.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda