How to compare files from two different branches

git diff can show you the difference between two commits: Or, equivalently: Note you must specify the relative path to the file. So if the file were in the src directory, you’d say src/myfile.cs instead of myfile.cs. Using the latter syntax, if either side is HEAD it may be omitted (e.g., master.. compares master to HEAD). You may also be interested in mybranch…master (from git diff documentation): This form is … Read more

Undo git pull, how to bring repos to old state

Running git pull performs the following tasks, in order: git fetch git merge The merge step combines branches that have been setup to be merged in your config. You want to undo the merge step, but probably not the fetch (doesn’t make a lot of sense and shouldn’t be necessary). To undo the merge, use git reset –hard to reset the local repository to … Read more

You have not concluded your merge (MERGE_HEAD exists)

OK. The problem is your previous pull failed to merge automatically and went to conflict state. And the conflict wasn’t resolved properly before the next pull. Undo the merge and pull again.To undo a merge:git merge –abort [Since git version 1.7.4]git reset –merge [prior git versions] Resolve the conflict. Don’t forget to add and commit the merge. … Read more

fatal: The current branch master has no upstream branch

You fixed the push, but, independently of that push issue (which I explained in “Why do I need to explicitly push a new branch?“: git push -u origin master or git push -u origin –all), you need now to resolve the authentication issue. That depends on your url (ssh as in ‘[email protected]/yourRepo, or https as in https://github.com/You/YourRepo) For https … Read more

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

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

What are the differences between git remote prune, git prune, git fetch –prune, etc

I don’t blame you for getting frustrated about this. The best way to look at is this. There are potentially three versions of every remote branch: The actual branch on the remote repository(e.g., remote repo at https://example.com/repo.git, refs/heads/master) Your snapshot of that branch locally (stored under refs/remotes/…)(e.g., local repo, refs/remotes/origin/master) And a local branch that might be tracking the … Read more

What is git fast-forwarding? [duplicate]

When you try to merge one commit with a commit that can be reached by following the first commit’s history, Git simplifies things by moving the pointer forward because there is no divergent work to merge together – this is called a “fast-forward.” For more : http://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging In another way, If Master has not diverged, instead … Read more

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