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.
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.