How to cherry-pick multiple commits

Git 1.7.2 introduced the ability to cherry pick a range of commits. From the release notes: git cherry-pick learned to pick a range of commits (e.g. cherry-pick A..B and cherry-pick –stdin), so did git revert; these do not support the nicer sequencing control rebase [-i] has, though. To cherry-pick all the commits from commit A to commit B (where A is older than B), run: If you want to ignore A itself, … Read more

rejected master -> master (non-fast-forward)

As the error message says: git pull before you try to git push. Apparently your local branch is out of sync with your tracking branch. Depending on project rules and your workflow you might also want to use git pull –rebase.

How can I git stash a specific file?

EDIT: Since git 2.13, there is a command to save a specific path to the stash: git stash push <path>. For example: OLD ANSWER: You can do that using git stash –patch (or git stash -p) — you’ll enter interactive mode where you’ll be presented with each hunk that was changed. Use n to skip the files that you don’t want to … Read more

How do you create a remote Git branch?

Simple Git 2.0+ solution: As of Git 2.0, the behavior has become simpler: You can configure git with push.default = current to make life easier: I added this so now I can just push a new branch upstream with -u will track remote branch of the same name. Now with this configuration, you will auto-guess the remote reference to … Read more

Why do I have to “git push –set-upstream origin “?

TL;DR: git branch –set-upstream-to origin/solaris The answer to the question you asked—which I’ll rephrase a bit as “do I have to set an upstream”—is: no, you don’t have to set an upstream at all. If you do not have upstream for the current branch, however, Git changes its behavior on git push, and on other commands as well. The … Read more

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