Git merge with force overwrite

Not really related to this answer, but I’d ditch git pull, which just runs git fetch followed by git merge. You are doing three merges, which is going to make your Git run three fetch operations, when one fetch is all you will need. Hence: Controlling the trickiest merge The most interesting part here is git merge -X theirs. As root545 … Read more

Undo git stash pop that results in merge conflict

As it turns out, Git is smart enough not to drop a stash if it doesn’t apply cleanly. I was able to get to the desired state with the following steps: To unstage the merge conflicts: git reset HEAD . (note the trailing dot) To save the conflicted merge (just in case): git stash To return to master: git … Read more

How to git add a whole folder

My guess is that you are trying to add folder while you already are in folder. Instead, add everything in the folder, rather than the folder itself: To your other question, adding whole folders is fine, but only relevant when adding sub-folders. Again, you can’t git add the folder that is your repository (my_folder above). The usual way to add everything in … Read more

Undo a git stash

You can just run: and it will unstash your changes. If you want to preserve the state of files (staged vs. working), use

Git pull origin overwrites master?

If you do a git pull with a remote branch name, it will fetch the remote branch and then merge it into your current local branch. So to undo that, you will first have to reset your local branch to the remote master, then create a new local vs12up branch from the corresponding remote branch. Reset your local master to match the … Read more

How to “git clone” including submodules?

With version 2.13 of Git and later, –recurse-submodules can be used instead of –recursive: Editor’s note: -j8 is an optional performance optimization that became available in version 2.8, and fetches up to 8 submodules at a time in parallel — see man git-clone. With version 1.9 of Git up until version 2.12 (-j flag only available in version 2.8+): With version 1.6.5 … Read more

‘cannot open git-upload-pack’ error in Eclipse when cloning or pushing git repository

Finally I made it work thanks to the steps outlined in the Eclipse forum: Set up the SSH key stuff Download and install mysys git according to the github instructions at http://help.github.com/win-git-installation/ In C:/Users/you/ssh hide any existing keys (id_rsa and id_rsa.pub) in a subdirectory. If the ssh directory does not exist, create it. Of course, “you” is … Read more

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