Tag: bash

Can not recognize java command when using git bash

Now I want to use git bash to run <a href=”https://github.com/tinkerpop/gremlin/wiki/Getting-Started”>gremlin</a>. However, when I ran gremlin.sh, it returned java command cannot be found. I can work quite well with java using eclipse on my windows laptop. So I think the building path may be the problem. I followed this answer. But it did not work. […]

GIT, Execute command on every changed filed?

I would like to execute some shell command on every file that has not staged changes. E.g. If git status shows On branch xxxxxxx Your branch is up-to-date with ‘origin/xxxxxxxxx’. Changes not staged for commit: (use “git add <file>…” to update what will be committed) (use “git checkout — <file>…” to discard changes in working […]

fatal: open /dev/null or dup failed: No such file or directory

I am new here and i will try to explain my question kindly ignore any mistakes. I am using git version git-2.8.2 It worked fine for one day then this problem occurs. I am using gcloud repository. First I tried gcloud clone command then this error occurs Then to make sure git is there I […]

How do I create a git hook to prepend commit messages with branch name?

I read another post that provided a somewhat working prepare-commit-msg, I modified it a little: #!/bin/sh # # Automatically adds branch name and branch description to every commit message. # # todo: # * breaks merge commit message # * breaks git commit –amend NAME=$(git branch | grep ‘*’ | sed ‘s/* //’) DESCRIPTION=$(git config […]

Git bash setup rejecting global/ local parameters, can't set up user account

OS: Win8.1 64bit; Git v 2.9.0 Git bash 2.9.0 set up rejecting user name & email configuration error messages. Installed -> exe’d -> no welcome message just computer name and $prompt. In command, I typed in the code provided by our TA: config [–local | –global] user.email “my email@etc.com”; rec’d error messages:: –global] user.email command […]

Git: Working with executables

I have a project in which there is a .sh file and it has to be in the executable mode once pulled by the others. Now, I already changed its permissions on my local machine. However I want it to be pushed/pulled as executable as well, so that the other users do not have to […]

git clone fatal: cannot create work tree dir permission denied

so I’m trying to clone a repository from git, into a folder i know I have write access in. I’m trying to clone it using IntelliJ’s built in VCS capabilities, and the git bash program from git-scm.com Both of them return the following error: fatal: could not create work tree dir ‘<repo name>’ : Permission […]

bash: optimizing a git-aware shell prompt

I’ve written the following PS1, which will append the current working branch to the shell prompt if I am in a git repo, and do nothing otherwise: PS1=’\[\e[00;32m\]\u@\h\[\e[0m\]\[\e[00;33m\] [\w]$(branch=`git symbolic-ref –short -q HEAD 2> /dev/null || git rev-parse -q –short HEAD 2> /dev/null` ; if [ $branch ] ; then echo -n -e ” \e[95m<$branch>” […]

How should I edit a patch checkout when removing lines?

I have a file bar.txt in which I removed 3 lines and did not stage anything yet. I want to restore one of the removed lines via git checkout -p. Example/Bash output: $ git checkout -p foo/bar.txt diff –git a/bin/custom/foo/bar.txt b/bin/custom/foo/bar.txt index 35483b7..e945cae 100644 — a/bin/custom/foo/bar.txt +++ b/bin/custom/foo/bar.txt @@ -1097,9 +1097,6 @@ mond.desc.refinements = Foo […]

git fails to clone: The remote end hung up unexpectedly

I’m using bitbucket for my team project. The problem only appeared after I deleted the local repository (because it wouldn’t let me commit changes, but that’s another story). But when i cloned for the first time, it did work (I used the HTTP URL). Currently, when I try to clone using the Visual Studio’s team […]

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