In a git merge, how do you just replace your version with the version git says there is a conflict with?

If their is a conflict during a merging operation (merge, cherry-pick, rebase, etc…) you can resolve conflict by picking one side of the changes by doing : git checkout –ours <path> (this will choose the local changes) or git checkout –theirs <path> (this will choose the remote changes) then finishing resolving the conflict as usual … Read more

SSH in git behind proxy on windows 7

Setting http.proxy will not work for ssh. You need to proxy your ssh connection. See this description. To summarize: Start git-cmd.bat and create ~/.ssh/config (notepad %home%\.ssh\config.) ProxyCommand /bin/connect.exe -H proxy.server.name:3128 %h %p Host github.com User git Port 22 Hostname github.com IdentityFile “C:\users\username\.ssh\id_rsa” TCPKeepAlive yes IdentitiesOnly yes Host ssh.github.com User git Port 443 Hostname ssh.github.com IdentityFile … Read more

GitHub can’t rebase my feature branch: “This branch cannot be rebased due to conflicts”

If you created the branch from main but you now need to rebase onto main then main must have been updated since you created your branch. The conflicts come from those changes. I understand that this can be resolved by: git checkout main git rebase feature/x (resolve conflicts) This isn’t correct. This would rebase main … Read more

Merging multiple branches with git

git checkout master git pull origin feature1 feature2 git checkout develop git pull . master (or maybe git rebase ./master) The first command changes your current branch to master. The second command pulls in changes from the remote feature1 and feature2 branches. This is an “octopus” merge because it merges more than 2 branches. You … Read more

git ignore filenames which contain

Add this line to your .gitignore *_autosave* According to git help gitignore patterns match relative to the location of the .gitignore file Patternz like *_autosave* match files or directories containing “_autosave” somewhere in the name. Two consecutive asterisks (“**”) in patterns mathed against full pathname may have special meaning A leading “**” followed by a … Read more