Tag: bash

How to set TERM environment variable in Windows so that it works with Bash via SSH and locally with Git?

Background: When using my Windows version of git in Powershell I found that I got the error “terminal is not fully functional” so I used the second solution posted here (i.e. change TERM to msys) to fix the problem. However, this caused a secondary problem that when SSH’d into my Vagrant box, command line apps […]

Aliasing github.token in ~/.gitconfig to a shell command

I would like to set the value of github.token in my ~/.gitconfig to be the result of a shell command. I currently have the following: [github] user = zmanji token = !echo ~/.githubtoken 2> /dev/null However git config github.token does not return the contents of the ~/.githubtoken file but the command itself. How can I […]

Git for Windows doesn't know %USERPROFILE%

I have the same issue like Git for Windows doesn't execute my .bashrc file and tried to make the same steps. But my Git Bash (2.5.0, 64bit on Windows 7, 64bit) doesn’t know my %USERPROFILE%. pitgrap@xxx MINGW64 / $ pwd / pitgrap@xxx MINGW64 / $ cd ~ bash: cd: /%USERPROFILE%: No such file or directory […]

Git Autocompletion looks weird (and only half-functional)

Following these excellent instructions for enabling Git bash autocompletion in OSX: curl https://raw.github.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash echo “source ~/.git-completion.bash” >> ~/.bash_profile I get the following output when I type “git TabTab” at the command line: Following multiple different tutorials produces the same result. Either I don’t know the right search terms or there is just very […]

Git diff – ignore reorder

git diff numbers diff –git a/numbers b/numbers index 5f5fbe7..d184fef 100644 — a/numbers +++ b/numbers @@ -1,3 +1,3 @@ -1 +4 +3 2 -3 Number 3 is repeated but the order is changed. Any way to ignore the reorder in git or any grep solution? I want the result of only added and deleted numbers, not […]

How to tell git branch name from commit hash?

I have a bash script which accepts a string of either a branch name (e.g., “master”, or “feature/foo”) or a commit hash (e.g. “1234abcd”). I have the repository checked out, so I can call git. What is the best way to determine whether the string is a branch name or a commit hash? #!/bin/bash commit_or_branch=”$1″ […]

Why is this a bad config line for my .gitconfig?

bd = “!f() { git branch –merged | egrep -v ‘(^\*|master|dev)’ | xargs git branch -d }; f” I’m trying to alias a git command to remove all of my local merged branches. When I put the bash command into my gitconfig as above, git complains about a bad config line: fatal: bad config line […]

Why 'git ls-files' is not shown on tab completion?

Recently I found the command git ls-files and I find it very useful (see the it with -h option). Why doesn’t it appear if i type git and then press Tab? I mean – where is the list of “other” commands of git?

Get SHA1 of latest remote commit

Possible Duplicate: git bash : how to check if there’s a new commit available I am writing a script where I would like to compare the latest local commit to the latest upstream commit in order to tell the user there are commits to be pulled. The latest local commit SHA is displayed with git […]

How to git pull for multiple repos on windows?

So I have a lot of repos, and sometimes I forget if some are behind on their pulls, so I was wondering there was a way to git pull for each repo in one .bat script. I saw someone do it for linux I believe here, but I’m on a windows machine. Does anyone know […]

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