Questions tagged [git-merge]

git-merge is a git command which integrates changes from another branch by incorporating commits into the currently checked-out branch.

A merge in version control is an operation where two sets of changes are combined to have both features available.

Git provides sophisticated merge support by automatically detecting simple merges (i.e. if only changes on one branch happened, also called fast-forward) and allowing plugable merge-strategies for more advanced use-cases.

3320 questions
1
vote
1 answer

Make my github master branch match another branch

I've been working on a forked branch "forkedBranch" and made many updates to my app. When I was happy with the updates, I went back to my master branch (git checkout master) and merged my forkedBranch (git merge forkedBranch). Unfortunately, the…
JimmyTheCode
  • 3,783
  • 7
  • 29
  • 71
1
vote
1 answer

What's command to change the commit in the HEAD file without changing any other files?

What's command to change the commit in the ".git\HEAD" file without changing any other files? I needed files from one branch, but the Head points to another
Ilya
  • 720
  • 6
  • 14
1
vote
0 answers

git stash merge into master branch

I'm knew to git and using TortoiseGit and Visual Studio Code. I try to achieve the following, but wasn't able to and didn't find solutions on the web yet: 2 branches: master and daily-backups daily-backups as the name implies should store a daily…
h4ppy
  • 11
  • 1
1
vote
1 answer

Git automerge unimportant difference using regex during conflict?

We have a file that is usually being generated automatically, and therefor it has a comment in the beginning of the file indicating the date of when the file was generated, i.e: // generation date 01/10/2020 When we use git rebase, between two…
shush
  • 11
  • 2
  • 6
1
vote
1 answer

git diff between two branches not matching the changes during a merge

I have two branches, master and feature. If I do: git diff --name-only master..feature I get a long list of files, some of them source code, so not excluded by .gitignore But, when I try to merge feature into master: git checkout master git merge…
mugetsu
  • 4,228
  • 9
  • 50
  • 79
1
vote
0 answers

How to update someone else's changes done in my local branch?

After sending a Pull Request with changes on my local branch (branch1), someone else pushed some more changes into my own branch (branch1). How do I update my own branch with those changes?
1
vote
1 answer

Git. How to update feature branch withour merging unneccessary commits?

Im a bit confused about these scenarios: I have a task. I create feature branch, make work here. And then I create Pull Request to release-test branch. In order to avoid conflicts, first I have to update my feature branch. So I have to merge…
1
vote
1 answer

How to prevent git from automatically doing a binary diff on large files?

I've read online that once the files in a merge exceed a certain threshold, git automatically does a binary diff instead of a textual one. As a result, we lose the functionality of line-by-line resolution, even if the diff itself is quite small. I…
paulinho
  • 292
  • 2
  • 13
1
vote
2 answers

Merge did not introduce merged changes

I had a branch which was merged off of commit A of branch main. I made a few changes and ended up like this: A-B-C-D I then merged the branch back to main introducing a merge commit. A fast-forward merge would have sufficed but our policy is to…
sigy
  • 2,408
  • 1
  • 24
  • 55
1
vote
1 answer

git pull broke something - how to go back to previous working commit and merge the remote changes in again?

I commited a new feature locally, pulled from remote and got merge conflicts. After resolving them, my feature stopped working (seems like I made an error). My idea was to go back to my commit and somehow repeat the merge. I checked out my commit,…
cssdev
  • 59
  • 7
1
vote
1 answer

Git Rebase already merged branch

I created feature branch from main develop branch called my-feature there is also another feature branch created by another developer another-feature. We both are doing changes in different files Another developer already create PR but, not merged…
ketan
  • 19,129
  • 42
  • 60
  • 98
1
vote
0 answers

Is there a way to merge offline and collect conflict statistics in Git?

For research purposes, I'm currently trying to benchmark Git's three-way merge algorithm. Ideally, I would want to do the following: First, create a local Git repository with some file original.txt. Suppose it contains the following: This is line…
paulinho
  • 292
  • 2
  • 13
1
vote
0 answers

Combine many related Git repositories into one repository with a commit history

So basically because of a university course I had to push repositories like this to my GitHub seperately because the professor preferred the oversight: /Assignment1 /Assignment2 /Assignment3 Etc. These all have a folder with a project inside, and…
Sophie Bushchak
  • 151
  • 2
  • 7
1
vote
0 answers

git - how to force manual merge on files in a specific folder, even when there is no conflict

I have one type of files which are located in specific folder, called 'testflow'. All files in this folder are text files which are auto-generated by GUI program, and any user can commit changes to this file, which we would like to be able to…
shlomi
  • 11
  • 1
1
vote
1 answer

Merging two files together into one file with git

I have folder A_Folder. Inside that folder there is file A_File.html. That folder is in branch_A of my repositroy. I have also a branch_b which has file B_File.html. How can i merge A_File.html and B_File.html together to save final code in…