Questions tagged [merge]

Merging is a generic term for combining two or more related sets of data. It is commonly associated with revision control systems when reconciling multiple changes made to a revision-controlled collection of files. Merging multiple data sets is another use of this tag.

Most often, it is necessary when a file is modified by two people on two different computers at the same time. When two branches are merged, the result is a single collection of files that contains both sets of changes.

In some cases, the merge can be performed automatically, because the changes do not conflict. In other cases, a person must decide exactly what the resulting files should contain. Many revision control software tools include merge capabilities.

Merge can be used as a verb ("to merge branches"), but can also be a noun ("this merge will be difficult").

Merging multiple data sets is another use of this tag.

Merge can also refer to the Ruby Hash#merge method for merge hashes or git merge command for git revision control system.

Merge is different from join in datasets which is primarily SQL based. Difference between merge and join for SAS is here http://www2.sas.com/proceedings/sugi30/249-30.pdf and for R is here How to join (merge) data frames (inner, outer, left, right)?

See Wikipedia: Merge Version Control.

24925 questions
7
votes
3 answers

How to merge pandas table by regex

I am wondering if there a fast way to merge two pandas tables by the regular expression in python . For example: table A col1 col2 1 apple_3dollars_5 2 apple_2dollar_4 1 orange_5dollar_3 1 apple_1dollar_3 table…
Wenqi Cheng
  • 81
  • 1
  • 4
7
votes
4 answers

Merge two folders in python

I need to merge two folders, The folders are named 12345 and 12345_ How would I merge the two? I have tried but I end up with '12345.' for file in files: subFolder = os.path.join(destpath, file[:6]) if not os.path.isdir(subFolder): …
lithocrat
  • 71
  • 1
  • 1
  • 6
7
votes
2 answers

git merge: filter files to avoid silly conflicts (like whitespace or case changes)

I'm currently inside a very complicated merge in git, and I have many conflicts. The conflict is about two Ada source files. I would like to make a merge that would ignore both whitespace changes and case changes (as the Ada language is case…
Mildred
  • 3,887
  • 4
  • 36
  • 44
7
votes
1 answer

Git: How do I merge complex branches that have widely diverged with some missing history?

I have two "branches", both of which started from the same code base, but both of which were imported to git after they diverged. The prior history is lost, and additionally both branches have extensive changes recorded in their git history. What…
fuzzyTew
  • 3,511
  • 29
  • 24
7
votes
3 answers

Merge Dictionary with Enumerable.Union method

I'm testing the UNION method to merge to dictionaries (of type Dictionary). It works fine with TValue type is string or int or even object. But if TValue type is a collection (tested with List and object[]) an exception is thrown :…
Florian
  • 4,507
  • 10
  • 53
  • 73
7
votes
3 answers

git: I accidentally merged feature branch into master instead of develop

I'm using git and working with master/develop/feature branches. The master only had the README file. And, unfortunately, I accidentally merged the feature branch I was working into the master instead the develop branch. And also removed the feature…
Rafael P. Miranda
  • 737
  • 10
  • 25
7
votes
5 answers

Diff between two dataframes in pandas

I have two dataframes both of which have the same basic schema. (4 date fields, a couple of string fields, and 4-5 float fields). Call them df1 and df2. What I want to do is basically get a "diff" of the two - where I get back all rows that are not…
mhy
  • 455
  • 2
  • 6
  • 12
7
votes
2 answers

Why merge trees to "last revision number at which the two trees were synchronized"?

In the TortoiseSVN documentation about merging, the instructions for "Merging Two Different Trees" state the following (emphasis mine): In both the From Revision field and the To Revision field, enter the last revision number at which the two trees…
Jean-François Corbett
  • 37,420
  • 30
  • 139
  • 188
7
votes
3 answers

Append a file in the middle of another file in bash

I need to append a file in a specific location of another file. I got the line number so, my file is: file1.txt: I am Cookie While the second one is file2.txt: a black dog named So, after the solution, file1.txt should be…
Wyatt Gillette
  • 318
  • 3
  • 14
7
votes
1 answer

Join/Merge two Pandas dataframes and use columns as multiindex

I have two dataframes with KPIs by date. I want to combine them and use multi-index so that each KPI can be easily compared to the other for the two df. Like this: I have tried to extract each KPI into a series, rename the series accordingly (df1,…
1nfern0
  • 147
  • 1
  • 6
7
votes
1 answer

fontforge - Script to merge fonts to add glyphs

I have two .ttf font files, one of which contains the glyphs that I need to merge to the other font file. Using the GUI, there will be a dialog box saying Do you want to retain kerning information from the selected font when one of the glyphs being…
sam-s3pi0l
  • 73
  • 1
  • 5
7
votes
2 answers

Why is Git merge creating multiple commits on master branch?

There are two branches I am working with, master and newFeature. While building the "new feature", I added multiple commits to the newFeature branch. My understanding of git merge is that it will create a single commit on master once the branches…
John Smith
  • 7,243
  • 6
  • 49
  • 61
7
votes
2 answers

Do jobs only for merge / specific commit message

I am not quite sure how the gitlab CI workflow should look like to achieve this: In my gitlab repository every feature will be developed in an own branch. At least the branch will be merged to master. I am using npm package grunt-bump to bump up…
user3142695
  • 15,844
  • 47
  • 176
  • 332
7
votes
2 answers

Does pandas dataframe merge work with greater or less?

Now i need to merge two dataframe with the condition greater than(>=). But merge only support equal. Is there any way to deal with it? Thanks!
J.Bao
  • 71
  • 1
  • 2
7
votes
1 answer

pandas merge on date column issue

I am trying to merge two dataframes on date column (tried both as type object or datetime.date, but fails to give desired merge output: import pandas as pd df1 = pd.DataFrame({'amt': {0: 1549367.9496070854, 1: 2175801.78219801, 2:…
muon
  • 12,821
  • 11
  • 69
  • 88