Pull in changes from a Github fork

Pulling in a single commit would be a cherry-pick and would rewrite the commit ID (and mark you as the committer while retaining the author). The process is pretty straightforward, though: git fetch git://github.com/user/project.git git cherry-pick <SHA-COMMIT-ID> You get the SHA from the repository log, for example: git log –oneline b019cc0 Check whether we have … Read more

Unmerge a git branch, keeping post-merge commits

Read through Pro Git – Undoing Merges. Basically, you git revert the merge commit: git revert -m 1 hash_of_merge_commit You may end up with some conflicts that you’ll have to manually unmerge, just like when merging normally. Additional links: Git SCM – Undoing Merges Git Ready – Rolling back changes with revert

Merge, update, and pull Git branches without using checkouts

The Short Answer As long as you’re doing a fast-forward merge, then you can simply use git fetch <remote> <sourceBranch>:<destinationBranch> Examples: # Merge local branch foo into local branch master, # without having to checkout master first. # Here `.` means to use the local repository as the “remote”: git fetch . foo:master # Merge … Read more

git merge, keep both

There is no ‘merge strategy’ for resolving these conflicts. However, if you truly want a conflict like: <<<< ours Foo ========= Bar >>>> theirs to resolve to Foo Bar then you can configure the ‘merge driver’. From the gitattributes man page: union Run 3-way file level merge for text files, but take lines from both … Read more

Git merge commits [duplicate]

git rebase -i HEAD~5 allows you to interactively select which of the 5 last commits to join into one; off the top of my head it opens the editor with something like this pick xxxx commit1 pick xxxx commit2 pick xxxx commit3 pick xxxx commit4 pick xxxx commit5 you change this into pick xxxx commit1 … Read more

git checkout –ours does not remove files from unmerged files list

It’s mostly a quirk of how git checkout works internally. The Git folks have a tendency to let implementation dictate interface. The end result is that after git checkout with –ours or –theirs, if you want to resolve the conflict, you must also git add the same paths: git checkout –ours — path/to/file git add … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)