Tag: merge

Merge commits where all parents are from the same branch are not allowed

I am having 3 branches i.e, develop, feature, xyz. Right now I am working in xyz branch and commit here. Then i have followed these steps git checkout feature git merge xyz — Here it copied that commit and created one more commit as “merge: prev_commit latest_commit”. So in feature i have 2 new commits […]

git branch restoration after merge

If I merge a git feature branch back onto master, is it best to then delete the branch? Let’s say 6 months later, I want to resurrect that deleted branch (assume a freshly cloned repo). Is there a way to easily re-create it or find its history assuming it was merged back onto master? What […]

Git: How do I remove a branch that has already been committed, pushed, and merged into master?

I have a branch that has been committed, pushed, and merged into master. It did not pass QA. We need to pull that branch out of master for a release. How do I pull that branch out of master. Assume the branch name is “to-be-removed”

Git Merge two repositories that are years apart with thousands of conflicts

Repository A: The old fork we’re working on now, but with hundreds of recent commits based on 3-year-old code from B. The history is long gone – it only goes back a few months when the repository was first uploaded to Github. Repository B: The new, current one we don’t have access to. Years of […]

Make All Merges Manual in Git

I need to know how to manually edit every merge. I found answers on here but everything is only when there is a conflict of merging. I implemented these and if there are new files pulled or no direct conflict between the code it will auto merge, which I can’t have. I want to manually […]

Is it OK to merge another branch into mine and then merge both into master

Let’s say I have three branches: master, feature-A and feature-B. I’ve added some commits to the feature-A branch and created a pull request that waits for code review. Now I want to work on feature-B, but I’d like to use the code I’ve added in feature-A. So, will it cause any problems if I: create […]

Add three versions to a new git repository

I have three different versions of a program, and now, much too late, I would like to move it into a git repository. Would it be possible to start a repository with the live environment and add the test and development environment each into a branch?

How to merge git repository with changes from different upstream

Years ago I created a public repository of a SourceForge project on Github. Back then, the project only supported CVS, so I used git cvs to periodically sync my repository with the original. There have not been any commits to the CVS repository for a long time, and now I found out that they moved […]

merge strategy in .gitattributes not working

I want git to never have a conflict on this file: test/file.txt when merging. I tried the following in .gitattributes test/file.txt merge=theirs but I need to define the theirs merge strategy. I saw online that I can define the ours strategy by executing this: git config –global merge.theirs.driver true which sets the driver to true […]

How to merge changes to both branches

Right now I have a develop branch, and I create a new branch feature-keyboard using git checkout -b feature-keyboard develop as a new version. Right now I need to do changes to both branches. What I am doing right now is I do so: git checkout -b feature-ui-changes develop and then add some changes commit […]

Git Baby is a git and github fan, let's start git clone.