What does diff.mnemonicprefix do?

I’ve noticed that SourceTree performs git commands with this configuration option: git -c diff.mnemonicprefix=false This is what the git docs say about this option: diff.mnemonicprefix If set, git diff uses a prefix pair that is different from the standard “a/” and “b/” depending on what is being compared. When this configuration is in effect, reverse […]

Why does “git svn fetch” command seem to be stuck and does nothing?

EDIT: Workaround. Now we understand the issue, here is the solution: do git svn fetch -r REVISION:HEAD where REVISION is the number of the svn commit of the branch creation. I’ve been happy using git svn to work on the trunk of my project for a while, but now I need to track branches also. […]

Git rollback 1 pull

I have a web server that serves a project that is a git repository. When I do some changes to the code I then do a git pull from the server. Sometimes the new code just crashes, I would like to be able to do a rollback to the latest pull, the one just before. […]

Git search all diffs

I’m trying to search for changes in my git history relating to a very specific variable name. I’ve tried doing this: git diff HEAD~25000 | grep -in mydistinctvariablename The results don’t tell me which commit the result lines are from and it takes quite a bit of time (about 5-7 minutes). Does anyone have a […]

If a git tag changes on remote, a git fetch does not update it locally. Is this a bug?

I fixed it for my repo by deleting the local tag and then doing a git fetch. This brought the updated tag. Is there are “right” way to update tags that may have changed on the remote? This is a simple tag, not signed or anything, created with “git tag “

How to change RGB colors in Git Bash for windows?

I’m using the Git Bash in Windows and for the purposes of my custom git log format, I’d like to modify the terminal’s exact RGB color values so I can fine-tune the color outputs. My git log format is as follows in my global .gitconfig: lg1 = log –graph –abbrev-commit –decorate –date=relative –format=format:’%C(bold blue)%h%C(reset)%x09%C(bold green)(%ar)%C(reset)%C(bold […]

git create commit from diff between two branches

I have two branches which have very little similar history, but are related to each other. I want the changes between those two in one git commit. files have been deleted and created between those patches and I want the patch to reflect that i.e.: the following stuff will not work: git diff branch_a branch_b […]

Check if git remote exists before first push

I’m writing a bash script and I need a test to see whether a given remote exists. Suppose, for concreteness, that I want to test whether the remote faraway exists. If I’ve pushed something to faraway, I can do if [ -d .git/refs/remotes/faraway ]; then …. But as far as I can see, the alias […]

Should checkins be small steps or complete features?

Two uses of version control seem to dictate different checkin styles. distribution centric: changesets will generally reflect a complete feature. In general these checkins will be larger. This style is more user/maintainer friendly. rollback centric: changesets will be individual small steps so the history can function like an incredibly powerful undo. In general these checkins […]

NPM install : Git URL dependency error in package.json

I want to set a dependency that is a Git URL of a private package in package.json I write : “dependencies” : { “mymodule” : “git://git@git.myrepo.com:/myproject#mybranch” } When running npm install I get this error : git clone git://git@git.myrepo.com:/myproject.git Cloning into bare repository ‘/hom /Ostro/.npm/_git-remotes/git-git-myrepo-com-myproject-git-4d838f3d’… npm ERR! git clone git://git.myrepo.com:/myproject.git npm ERR! git clone git://git.myrepo.com:/myproject.git […]

Git Baby is a git and github fan, let's start git clone.