git-bash

Bash mkdir and subfolders [duplicate]

 ̄綄美尐妖づ 提交于 2019-11-28 03:25:49
This question already has an answer here: How to create nonexistent subdirectories recursively using Bash? 3 answers Why I can't do something like this? mkdir folder/subfolder/ in order to achive this I have to do: mkdir folder cd folder mkdir subfolder Is there a better way to do it? You can: mkdir -p folder/subfolder The -p flag causes any parent directories to be created if necessary. To create multiple sub-folders mkdir -p parentfolder/{subfolder1,subfolder2,subfolder3} FWIW, Poor mans security folder (to protect a public shared folder from little prying eyes ;) ) mkdir -p {0..9}/{0..9}/{0

git config core.autocrlf is true, but I'm still getting a warning?

余生长醉 提交于 2019-11-27 23:09:46
问题 I understand that Windows uses CRLF and that it's good practice to let Git change line endings to LF before committing and back to CRLF when checking out. For that reason, I have core.autocrlf set to true. However, contrary to what other threads say (e.g., this), I am still getting this warning: warning: LF will be replaced by CRLF in [FILE_NAME]. The file will have its original line endings in your working directory. Firstly, I thought setting core.autocrlf to true was supposed to stop these

How do I run msysgit in cmder?

时间秒杀一切 提交于 2019-11-27 20:44:14
问题 I was using msysgit and git-bash in cmder when I accidentally exited out of it. Now I can't seem to figure out how to get to the unix environment I previously had. Git bash is not recognized as a command. All I see is the typical command window prompt displaying the C:/User/.. rather than the $~User . How would you restore the git bash session? 回答1: You can type the full path of your msysgit intallation (2014, Git 1.9.z) to launch a bash session. For instance: "c:\prgs\git\PortableGit-1.9.0

Unicode (utf-8) with git-bash

和自甴很熟 提交于 2019-11-27 17:59:04
I'm having some trouble getting unicode to work for git-bash (on windows 7). I have tried many things without success. Although, I'm not quite sure what is responsible to for this so i might be working in the wrong direction. It really seems this should be possible as the encoding for cmd.exe can be changed to unicode with 'chcp 65001'. Here are some things I've tried (besides the obvious of looking through the configuration options in the GUI). Setting environment variables in '.bashrc'. I guess it makes sense this doesn't work since i think it's a linux thing. The 'locale' command does not

Can't start foreman in Heroku Tutorial using Python

时光毁灭记忆、已成空白 提交于 2019-11-27 17:58:54
I have been attempting to complete this tutorial , but have run into a problem with the foreman start line. I am using a windows 7, 64 bit machine and am attempting to do this in the git bash terminal provided by the Heroku Toolbelt. When I enter foreman start I receive: sh.exe": /c/Program Files (x86)/Heroku/ruby-1.9.2/bin/foreman: "c:/Program: bad interpreter: No such file or directory So I tried entering the cmd in git bash by typing cmd and then using foreman start (similar to a comment on one of the answers to this question suggests). This is what that produced: Bad file descriptor c:

Getting ssh-agent to work with git run from windows command shell

拥有回忆 提交于 2019-11-27 16:56:03
I have msysgit installed, with OpenSSH. I am connecting to a gitosis repo. From the git bash, I have created a .profile file that runs ssh-agent (if not already running) each time git bash is opened, using this script SSH_ENV=$HOME/.ssh/environment function start_agent { echo "Initialising new SSH agent..." /usr/bin/ssh-agent | sed 's/^echo/#echo/' > ${SSH_ENV} echo succeeded chmod 600 ${SSH_ENV} . ${SSH_ENV} > /dev/null /usr/bin/ssh-add; } # Source SSH settings, if applicable if [ -f "${SSH_ENV}" ]; then . ${SSH_ENV} > /dev/null #ps ${SSH_AGENT_PID} doesn't work under cywgin ps -ef | grep $

How to read the last line of a text file into a variable using Bash? [closed]

对着背影说爱祢 提交于 2019-11-27 16:42:36
问题 I want to read a text file called history.txt that contains multiple lines and store the content of the last line into a variable called "tag". Thanks 回答1: tag=$( tail -n 1 history.txt ) 回答2: cat FileName | while read oneline do echo "a oneline: $line" done 来源: https://stackoverflow.com/questions/42987486/how-to-read-the-last-line-of-a-text-file-into-a-variable-using-bash

Show files in current directory using Git Bash?

萝らか妹 提交于 2019-11-27 13:45:24
问题 How can I check files in current directory, from git bash? Like command dir , in Windows cmd ? I found a command git ls-files , but it's work only with git repository files. But if I navegate through drive C:\, and want to see files in current directory, how can I do that in git bash? 回答1: The git bash is basically a Unix shell, therefore you can list current files and directories with the ls command You can also use ls -a to show hidden files and folders. Since it is a Unix shell, you can

How come npm install doesn't work on git bash

本小妞迷上赌 提交于 2019-11-27 12:03:23
问题 I have git bash open and I type in npm install and then it returns: bash: npm command not found I don't understand, because I have node.js command prompt and when I type in npm -v then it returns 3.7.3 . How come it doesn't work in git? 回答1: In git bash type ... which npm This will tell you where npm is installed. Now, I'm assuming this will give you nothing since it seems npm is not on your system PATH variable. The PATH variable defines where Windows looks for commands. Go into your control

Windows shortcut to run git bash script

被刻印的时光 ゝ 提交于 2019-11-27 11:54:20
Assuming I have a test.sh script that runs a server and Git Bash installed, how do I create a Windows shortcut that I can double click to run tesh.sh in Git Bash in the foreground and allows me to see the output of the server? Git bash is already a batch file with content similar to this : C:\WINNT\system32\cmd.exe /c ""C:\Git\bin\sh.exe" --login -i" If you want run (and leave running) a shell script in the context of the shell, specify it at the command line. The trick is that when the script file name is interpreted, it uses the Windows path , not the equivalent path in the sh/Git