Tag: bash

Git bash win32exception: Failed to write credentials

I’ve recently started using GitHub but for some reason every time I attempt to pull or push it asks for my credentials. I’m 100% sure I have my credentials correct but git bash keeps giving this error: fatal: Win32Exception encountered. Failed to write credentials I don’t know why but it does work every time I […]

how to start bash in a directory in windows .bat?

This question already has an answer here: CMD Command for “Git Bash Here” 3 answers

Python Git Bash CMD Script

The code is pretty straightforward, it just opens windows command prompt and executes the calling() function. It has basic git commands which help me push to a git repo. I have configured ssh and remote repo. Link:https://github.com/vivekpatani/git-script-gitter I can change the date, but when I push it to git, it displays the current date on […]

Filter lines by pattern in bash script

I have two variables, one with text, and another with patterns. And I want to filter out lines, matched patterns. How can I do that? My script looks like this # get ignore files list IGNORE=`cat ignore.txt` # get changed files list CHANGED=`git diff –name-only $LAST_COMMIT HEAD` # remove files, that should be ignored from […]

finding the name of git branch from remote server

i am trying to find the name of git branch on remote server using a shell script. I put the following command in a script under the bin directory. git symbolic-ref –short HEAD When I execute the script using ssh from another machine ssh -i keyfile.pem user@ipaddress ‘bash -s’ /path/to/the/script I get an error fatal: […]

How to create files and folders automatically through Terminal?

How can the grouped/generalised Linux commands work on Windows env? (using Windows RT 2012). I am using Git BASH but can’t achieve the following: At the project root, I try the following to create lib folder and its subfolders mkdir -p lib/{login, signup, users, posts} touch !!:2/{package.json, index.js} The one below works but I want […]

Bash shell is not taking the arguments in a way I would expect?

I run the script below as such push repo “message” However if my message has spaces in it the script will break. Obviously the interpreter, see any spaces as indication of a new argument. How can I change the behavior so that I can write a complete commit message with spaces. push() { local a=$1 […]

Asking for password when pushing to gitlab?

I have a number of commits on my laptop and I am trying to push these to gitlab through a ShrewSoft VPN. However, every time I try to push the code I am asked for a password in my git bash. I have tried using my VPN password but it just throws an error. I […]

How can I set up an alias for “git last” that accepts a number as an argument?

In Pro Git Scott Chacon gives some nice examples of some alias which might be helpful, including one that shows the last commit: git last which is the equivalent of log -1 HEAD: git config –global alias.last ‘log -1 HEAD’ It will show something like this: $ git last commit 66938dae3329c7aebe598c2246a8e6af90d04646 Author: Josh Goebel <dreamer3@example.com> […]

Git Pull without typing private key password

I’m going to setup a cronjob for git pull changes on my test webserver. But my private key has a password, How could i pass it as argument? git pull something mypassword I’m willing to use it on a cronjob and I don’t want to leave private key without password. Thanks

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