git-bash

“Git Bash here” is not preserving bash history between sessions

爷,独闯天下 提交于 2019-12-05 03:45:24
I am running Git-1.8.0-preview20121022 on Windows 7 and the install was with "Git Bash Only" (least intrusive to Windows cmd). When I open the Git Bash from the start menu shortcut, everything is fine with the history. But when the Git Bash here context menu (either the git-cheetah shell extension one or the simpler registry one) is what launched a session, the commands from that session are not saved to the .bash_history . How could figure out why this is happening? Or better yet, does someone know how to fix this? Steven Penny You should be able to fix this by adding this line to your ~/

How do I test if a string starts with another in bash?

心已入冬 提交于 2019-12-05 03:43:31
Very similar but not duplicate : https://stackoverflow.com/a/2172367/57883 I'm in Git Bash 3.1 (at least that's what comes up in the prompt when I type bash inside git bash. and $ test [["DEV-0" == D*]] || echo 'fail' prints fail. if [['DEV-0-1' == DEV* ]]; then echo "yes"; says [[DEV-0-1: command not found I'm trying to test if git branch returns something that starts with DEV. but I can't seem to apply the answer. is it because all my attempts are using a string literal on the left instead of a variable value? I've also tried it on ideone http://ideone.com/3IyEND and no luck. It's been ~14

Why does Ctrl-Z on Windows Git bash shell fail?

混江龙づ霸主 提交于 2019-12-05 01:53:27
I sometimes have to work in Windows, which often means using the Bash shell. If I am (for example) in vim ( not gvim ) with several files open, and I hit Ctrl Z to briefly go back to the shell and do something before returning to vim , instead of suspending my vim process Git Bash creates a new DOS shell. This is the last thing I'd ever want. Googling turns up nothing useful (at this point in time - YMMV in my future). What is going on? I sometimes have to work in Windows, which often means using the Git Bash shell. Good. Me too. If I am (for example) in vim (not gvim) with several files open,

Set SSH Identities In Bashrc

跟風遠走 提交于 2019-12-04 22:52:27
I have a .bashrc file to start my ssh agent ( taken from here ). Whenever I start my machine I keep having to add my identities to it (using ssh-add ~/.ssh my_private key ). Not knowing bash scripting much, what (and where) do I adjust this script to add in my identities? SSH_ENV="$HOME/.ssh/environment" # start the ssh-agent function start_agent { echo "Initializing new SSH agent..." # spawn ssh-agent ssh-agent | sed 's/^echo/#echo/' > "$SSH_ENV" echo succeeded chmod 600 "$SSH_ENV" . "$SSH_ENV" > /dev/null ssh-add } # test for identities function test_identities { # test whether standard

crontab command not found in my git-bash for windows 7

本秂侑毒 提交于 2019-12-04 22:33:16
I cannot use crontab -e in my git that I installed it in my pc windows 7. It produced the error bash: crontab: command not found Did someone use to do it, please tell me? VonC I confirm that even the latest git for windows (2.6.3) with its 4.3.42(3)-bash does not include any cron command. You would need to use another "cron from Windows" , like the official Microsoft command Schtasks.exe . 来源: https://stackoverflow.com/questions/33775581/crontab-command-not-found-in-my-git-bash-for-windows-7

Is it possible to write a script on a server side hook on github

南笙酒味 提交于 2019-12-04 21:38:02
Is it possible to write my own scripts on git server hooks.If yes how can i do that i wanted to check when someone pushes to the server on which branch they are pushing just to make sure they don't push to the wrong branch. No it is not. You can use GitHub webhook , for GitHub to send message (payload) to your server (where you can listen to said message and trigger your own script) But nothing would be executed on a GitHub server itself, for security reason. 来源: https://stackoverflow.com/questions/26375086/is-it-possible-to-write-a-script-on-a-server-side-hook-on-github

stdout is not a tty. Using bash for node + tape + tap-spec

旧街凉风 提交于 2019-12-04 20:59:29
Was looking at a tape + tap video and tried to get it to work. OS: Windows 7 Git Bash Shell node main.js | ./node_modules/.bin/tap-spec stdout is not a tty. main.js: var test = require('tape'); var add = require('./add'); test('add: two numbers add correctly', function(t) { var actual = add(1,2); var expected = 3; t.equal(actual, expected); t.end(); }); add.js: module.exports = function(a, b) { return a + b; }; winpty node main.js | ./node_modules/.bin/tap-spec doesn't fix the problem. Diagnose : Theres nothing wrong with the code, I get the following output : (OS : ArchLinux) add: two numbers

How to get success count, failure count and failure reason when testing rest webservices from file using shell script

孤街醉人 提交于 2019-12-04 20:33:43
Hi i am testing web services using shell script by having multiple if condition, with the shell script coding i am getting success count, failure count and failure reason success=0 failure=0 if curl -s --head --request DELETE http://localhost/bimws/delete/deleteUser?email=pradeepkumarhe1989@gmail.com | grep "200 OK" > /dev/null; then success=$((success+1)) else echo "DeleteUser is not working"$'\r' >> serverLog.txt failure=$((failure+1)) fi if curl -s --head --request GET http://localhost/bimws/get/getUserDetails?email=anusha4saju@gmail.com | grep "200 OK" > /dev/null; then success=$((success

Wincred not working properly with Git Bash(Git for Windows) when executing certain commands like “prune”

别来无恙 提交于 2019-12-04 20:20:40
I have setup GitforWindows in my Windows 7 64Bit pretty well with Credential manager as "Wincred". Yet when I run some commands like git remote prune origin in GitBash, it gives following error in console, though runs the command: Failed to load advapi32.dll Why is that ? If there is something need to be done with Credential manager settings, then I need full explanation of how to do those settings and what each setting means. Note: This problem I have only with some commands, other commands are running just fine without any errors. If you are using the latest Git for Windows , make sure to

How to rename an annotated tag in Git

余生长醉 提交于 2019-12-04 19:58:40
问题 How can an existing annotated tag be renamed in Git? I have almost a hundred tags representing version numbers on a repository, and each tag is annotated with a useful description about what was changed that version. I'd like to change the naming style I've used for these tags, and recording the tag message, deleting the tag, and recreating it with the old message and a new name would be a nightmare to do manually for almost a hundred tags. A script or a series of git commands to do this