Tag: bash

Making an alias in cygwin to connect to a directory

I want to make a shell alias to connect to a directory I do all of my work in. I have tried the following in my .bashrc file: alias gitImmersion=”cd ‘c:/java/Git-Immersion/git_tutorial/work'” and alias gitImmersion=’cd c:/java/Git-Immersion/git_tutorial/work’ In both cases I get a No such file or directory error, but when I type the command in by […]

Use git description and parse value as a string inside bash script?

When I do a git push live master I want to check the version by using git describe on the server side, but when the below executes the variable is empty? Since the repo is bare, maybe I cant access that, or inside the post-receive I cant execute or something? #!/bin/sh currentVersion=`git describe –abbrev=0` echo […]

Git blame history stats

As git blame can be used to show what revision and author last modified each line of a file, it can be used to output statistic of how many LOC are currently in the repository originating from each committer: $ git ls-tree –name-only -z -r HEAD | \ egrep -z -Z -E “\\.(cc|h|cpp|hpp|c|cs|R|r|py|tex)$” | \ […]

Quickly detect added/removed files inside git repository

Let’s say I have a git repository with a .gitignore. I want to ‘snapshot’ the repository at some point in time, and save some sort of digest in a location outside of the repository (I mustn’t change the repository). Then, I want to be able to detect if there are any files added or removed […]

Create symlink that works on different machine when pulled with git

I have a repository on my local machine with a few symlinks. When I clone into it from a remote server, the links are broken. I’m using this command to make the links (mac). ln -s mySource/pathTo/file.txt file.txt How can I make the link relative so when it gets pulled in, it uses the ubuntu […]

SSL certificate validate fails

I am trying to use Git Bash to pull code frm stash. After I made: $ git clone http://source/code/address.git The bash terminal gives me error message: SSL certificate problem: self signed certificate in certificate chain Then I added the SSL certificate into the config file according to the higest voted answer: (https://stackoverflow.com/questions/9072376/configure-git-to-accept-a-particular-self-signed-server-certificate-for-a-partic) And I check […]

git http authentication problems on windows

I have a strange behaviour with git on Windows. Some information Windows 7 git version 1.9.5-preview20150319 If I try to clone a repository from the git bash with the http protocol like: git clone http://myhost/myRepository I get the error fatal: Authentication failed for http://myhost/myRepository If I clone the repository with the egit Eclipse plugin I’m […]

git branch vs $(git branch)

When I execute git branch on the command line I get a list of all the branches on a repo, however when I execute $(git branch) in a sub-shell, it first prints out a list of files in the top level folder in a repo before printing out the branch names. Why? I’m basically trying […]

Vagrant up, Cannot remove Nginx folders, 'no such file or directory'

I’m using a laptop running windows 8.1 64 bit I’m using Virtualbox 4.3.30 and vagrant 1.7.3. (I had some problems with it not being able to changing some folder names, so I had to downgrade Virtualbox) Currently it seems i’m experiencing some issues with my provisioner, it is trying to remove something from the nginx […]

Using git as part of an automated script – pausing the script for a rebase

I’m using git as part of a script automating a file patch. It goes something like this: cd “$gitdir” git checkout original monodis “$original_dll” > “$ilfname” git add “$ilfname” git commit -m “$(date +”%s”)” git checkout modded git rebase original # More code here As you can probably guess – this disassembles a .NET dll […]

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