Tag: bash

git seems confused about whether a file has changed (with autocrlf=true option)

I have this rule set in my git config: autocrlf = true this is to avoid problems we’ve had where our designers (who use mac) can’t open text files that have been saved by our dev team (who use a mix of mac and linux). One file in particular (which was created recently) is causing […]

Running MinGW/MSYS tools inside msysgit

I’ve been using msysgit for quite a while for Git on Windows, but I’m now trying to set up MinGW for the first time. I installed MSYS with mingw-get since it has some utils not packaged with msysgit (make, xz, etc.). I’ve some across some threads for running Git in the MSYS shell, but I’d […]

How can I use Git to identify function changes across different revisions of a repository?

I have a repository with a bunch of C files. Given the SHA hashes of two commits, <commit-sha-1> and <commit-sha-2>, I’d like to write a script (probably bash/ruby/python) that detects which functions in the C files in the repository have changed across these two commits. I’m currently looking at the documentation for git log, git […]

Relink with a Github Repository on a New Machine

I set up a github repository a while ago: https://github.com/LiamBailey/TweetSlider, with code for a little jQuery script to pull recent tweets for a given user and display them in a slider. Now I have added a few new features, and also made it a jQuery plugin. The first version was called TweetSlider v1 and the […]

Adding Git Bash Alias

I have created an alias for this git diff –stat origin/master. The alias for this is [alias] dp = “!DIFF_PREVIEW=$(git diff –stat origin/master HEAD);” When I run dp, Git Bash works, but it does not show anything in the terminal window. If I type git diff –stat origin/master, it actually shows my commits in the […]

Git Pre-Commit Using Sed To Dynamically Inject Branch Name

I am using a git pre-commit hook to: Get the current branch name Insert the branch name into a build status image code Search the README.md file for a string/pattern and then use that string/pattern as a marker for where I want to insert the dynamically generated build status image. Note that I am using […]

Smart auto-completition for staged git file names, used with difftool

I’d like to have a smart auto-completition of currently staged file names when using git diff. Example: modified: DIR1/LongCamelCaseFileName.h modified: DIR1/AnotherLongCamelCaseFileName.m modified: DIR1/AndThereAreALotOfThemInDir1.m modified: DIR2/file4.m and here, using bash tab-auto-complete functionality I’d like to use it with git diff where by smart I mean that after typing git diff I’d need to type only a […]

Implement .gitignore behavior in a shell script?

I’m writing a shell script that syncs files and I want to give users the ability to exclude certain files from syncing by creating a .syncignore file similar to Git’s .gitignore file. According to the gitignore documentation, and my own experiments, these exclusion rules are more complicated than a simple glob match. Some examples: If […]

Git – fatal: Could not get current working directory?

When I git clone from a repo, I get, fatal: Could not get current working directory: No such file or directory What do I do? I have checked the server and found that .git file exists. The server is running a Gitlab instance. I have configured ssh properly with the keys, and I’ve been committing […]

Error 0x2 starting node.exe -v in Git bash for Windows

I have installed Gitbash for windows version 2.7 and installed nodejs 5.5 on windows 7 64 bit machine. when I try to run node -v i get the the error msg Error 0x2 starting node.exe -v I am not sure why is this happening, I uninstalled and re installed both node and git, restarted my […]

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