Linked Questions

4 votes
4 answers
2k views

Git, must pull, know there will be conflicts, but local version is irrelevant

I know that upon pulling there will be conflicts, but I already know that the repository version is better. How do I resolve all conflicts on the command line with a git command something like $> ...
CQM's user avatar
  • 43.5k
5 votes
2 answers
5k views

Git: how to use rebase with theirs strategy

Basically, I just want to (re)set the parent (let's say to commit A) of a specific commit (commit B) which is the root commit of some branch x. It is suggested here in one of the answers that I can do ...
Albert's user avatar
  • 66.7k
2 votes
3 answers
5k views

Git force merge dev branch to master branch (overwrite all local files)

I have an old, out-of-sync project code in the master branch. Several files have been deleted, added, re-written and thoroughly edited. I want to force merge stable latest code from development branch ...
jerrymouse's user avatar
  • 17.3k
3 votes
1 answer
5k views

Git Pull Request no changes but git diff show changes

I have an issue with my branches Introduction I have 3 branches on my project : Dev, Main & Staging On Dev branch we add new features, on Main branch we fix bugs, on Staging we deploy for testing. ...
Nathan Bruet's user avatar
2 votes
1 answer
3k views

Hard Merging in git

I want to merge a branchA with the master branch such that in case of any conflict branch A overrides the master branch. Basically I want to replace the master branch by branch A Any idea?
Shagun Sodhani's user avatar
3 votes
4 answers
345 views

How to have a separate branch for tagged commits only?

I was tasked to organize the repository in the way that aside other branches there would be a dedicated branch, where we would only store the commits of released version. Below is the simplified ...
user avatar
2 votes
2 answers
2k views

Git: Add merge rule to config for specific file

I am using git to track a large LaTeX document which I write using Kile on different machines. Kile writes to its .kilepr config file when closing Kile. The problem I often run into is that I commit ...
user334287's user avatar
2 votes
2 answers
1k views

git pull with gzip files in repo?

I have a repo that contains my minified css/js files. Some of them are gzipped. When i go between staging and production doing push and pulls it tries to auto merge and fails on the gz ones citing ...
schone's user avatar
  • 572
3 votes
2 answers
4k views

'Ignore' binary files in git rebase 'theirs'

I want to go from this A - B - C - D - E - F - G where Branch1 is pointing at E and Branch2 is pointing at G to this: Branch1: A - B - C - D - E \ Branch2: F -...
Benjol's user avatar
  • 65.4k
3 votes
2 answers
1k views

Git: merge master to new branch and clear out master

I was wondering if somebody could explain to me how to GIT merge master into a new branch and then clear out master as to have master clean working directory. In other words: master -> PHP since ...
Jordon Bedwell's user avatar
2 votes
1 answer
2k views

Rollback a pushed rebase

I made a mess on my branch after trying to rebase to the master. In my commit history, I had quite a bit of refactoring (renaming and moving), along with deletion of classes. And I SHOULDN'T have ...
David Zhao's user avatar
  • 4,384
2 votes
2 answers
789 views

git merge branch overwriting destination

My repository have a master and dev branch. At this time I wish merge the dev with the master, or better, not a merge, but total replacement the content of the master branch with the dev. Is it ...
ghiboz's user avatar
  • 7,933
1 vote
2 answers
2k views

Update downstream by replacing with upstream and re-applying downstream changes, using git?

Using git, is there a good way to get the latest from upstream and re-apply our downstream changes? Instead of merging the upstream branch into the downstream branch that already contains our ...
Jason Spangler's user avatar
3 votes
2 answers
1k views

Git strategy for merging to a Prod branch from two different code lines (regular release branch and a hotfix branch)

Our long running git branches are Master, UAT, and Prod such that new functionality is worked on and committed initially to Master, promoted to UAT (when ready for UAT) then promoted to Prod (when ...
BestPractices's user avatar
1 vote
3 answers
370 views

How could I use a different strategy for just one commit in a rebase?

Given this: master A---B---G---H---I \ branch C---D---E---F Is there anyway to get to the following, but using -X theirs only for the C commit? master A---B---G---H---I ...
Benjol's user avatar
  • 65.4k

15 30 50 per page