Is there a way of setting up a branch such that it can only be merged into, rather than pushed into? Furthermore, is there any way that works on BitBucket, GitLab or GitHub? We work on feature branches, push those to BitBucket/GitLab/GitHub (depending on the project), and then merge them into an integration branch called […]
I merged in changes from another branch but I am getting conflicts because a file has been deleted on the remote branch but has changes on local branch. I would like to delete the file – I tried git rm path/to/file but it says file: needs merge. What is the best way of removing the […]
From what I read, both of them help us get a linear history. From what I experimented, rebase works all the time. But merge –ff-only works only in scenarios where it can be fast forwarded. I also noticed, git merge creates a merge commit, but if we use –ff-only, it gives a linear history which […]
I have branch where I have one command that only modify whitespace (trailing whitespace and indent). I’ve try to run git rebase master and git rebase –ignore-whitespace master and in both cases I have merge conflict in commit that change only whitespace.
I have a pull request that Github says it can’t automatically merge. This change is behind master a few commits, but without conflicts. Manually merging I don’t get any conflicts, and I get this output: (on master) $git merge otherbranch [vim pops up for commit message, :wq] Auto-merging <file> Merge made by the ‘recursive’ strategy. […]
I have had a look at When do you use git rebase instead of git merge? But I’d like to be sure about which solution to choose in this case : I want to implement a new feature on Master so i branch it to a new Feature branch. I do 10 commits on Feature […]
I’ve seen many blog posts and stack overflow posts say that git config –global diff.algorithm patience will allow both diffs and merges to use the patience strategy option with the default recursive algorithm. I have found this to not be the case, and I pose the following demo to show why not. git config –global […]
After merging branched I’ve received a conflict (rename/rename) on bunch of files, with file~HEAD, and file~my_test_branch created. How to resolve these? Thanks
I pull from my branch: git checkout mybranchSample git fetch git pull origin master Then, Git gives me the following message: Please enter a commit message to explain why this merge is necessary, especially if it merges an updated upstream into a topic branch And after entering a commit message, it merges master into my […]
git sometimes gives me this message on a conflict (during a revert or cherry pick) hint: after resolving the conflicts, mark the corrected paths What does this mean?