git-bash

Windows shortcut to run a Git Bash script

大城市里の小女人 提交于 2019-11-26 17:37:41
问题 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? 回答1: 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

Change the location of the ~ directory in a Windows install of Git Bash

本秂侑毒 提交于 2019-11-26 17:30:24
问题 I am not even sure I am asking the right question. Let me explain my situation: This is about Git on Windows 7. My company sets up the Windows user directory on a network drive, not on the local hard drive (for backup and other purposes beyond the scope of this question). I cannot change that policy. I CAN have local files outside of that scheme however and that is how my Apache server is set up. Entirely local. I installed Git. It installs Bash. When I fire up Bash and cd ~ (change to the

Git for Windows: .bashrc or equivalent configuration files for Git Bash shell

旧时模样 提交于 2019-11-26 17:00:39
I've just installed Git for Windows and am delighted to see that it installs Bash. I want to customise the shell in the same way I can under Linux (e.g. set up aliases like ll for ls -l ), but I can't seem to find .bashrc or equivalent configuration files. What should I be editing? Charles Ma Create a .bashrc file under ~/.bashrc and away you go. Similarly for ~/.gitconfig . ~ is usually your C:\Users\<your user name> folder. Typing echo ~ in the Git Bash terminal will tell you what that folder is. If you can't create the file (e.g. running Windows), run the below command: copy > ~/.bashrc The

What is the exact meaning of Git Bash?

时光毁灭记忆、已成空白 提交于 2019-11-26 15:47:55
Git Bash I have been working with Git Bash for the last two days. I know now the basic operations such as commit , push , pull , fetch , and merge . But I still don't know what Git Bash itself actually is! I've searched a lot about Git Bash, but all sites which I have seen focus on the functionality of its commands. I still haven't found a good answer for my question. Now, I think, I'm in the right place to get this answer! VonC git bash is a shell where: the running process is sh.exe (packaged with msysgit , as share/WinGit/Git Bash.vbs ) git is a known command $HOME is defined See " Fix

-bash: __git_ps1: command not found

ⅰ亾dé卋堺 提交于 2019-11-26 15:31:03
问题 I tried to install Ruby 2.0. My command line urped and now looks like the following: -bash: __git_ps1: command not found [11:58:28][whatever@whatever ~]$ I have not a clue how to get rid of the __git_ps1 command not found error. I've searched my .bash_profile and my .bashrc to see if it's trying to set a variable or something and am not seeing anything. The only place I can find git_ps1 mentioned is in ~/.dotfiles/.bash_prompt. I replace the content of that file completely, logout and log

How do I change the default location for Git Bash on Windows?

醉酒当歌 提交于 2019-11-26 12:35:21
问题 I am using Git on Windows 7 and access my repositories through Git Bash. How can I change the default location that Git Bash opens in a convenient folder when I start it? It\'s somewhat time consuming to navigate to htdocs , and then a specific folder. Is there a way to change the configuration file to have it open elsewhere? Or would it be possible to write a .sh file to do this? Unfortunately Git Bash won\'t open my htdocs folder shortcut on my desktop, and it takes using cd 5 times to get

Running SSH Agent when starting Git Bash on Windows

假如想象 提交于 2019-11-26 12:34:33
问题 I am using git bash. I have to use eval `ssh-agent.exe` ssh-add /my/ssh/location/ every time when I start a new git bash. Is there a way to set ssh agent permanently? Or does windows has a good way to manage the ssh keys? I\'m a new guy, please give me detailed tutorial, thanks! 回答1: In a git bash session, you can add a script to ~/.profile or ~/.bashrc (with ~ being usually set to %USERPROFILE%), in order for said session to launch automatically the ssh-agent . If the file doesn't exist,

How to remove a directory from git repository?

廉价感情. 提交于 2019-11-26 10:55:57
I have 2 directories on my GitHub repository. I'd like to delete one of them. How could I do that without deleting and re-creating entire repository? karmakaze Remove directory from git and local You could checkout 'master' with both directories; git rm -r one-of-the-directories git commit -m "Remove duplicated directory" git push origin <your-git-branch> (typically 'master', but not always) Remove directory from git but NOT local As mentioned in the comments, what you usually want to do is remove this directory from git but not delete it entirely from the filesystem (local) In that case use:

Cannot push to Git repository on Bitbucket

北战南征 提交于 2019-11-26 10:05:52
问题 I created a new repository and I\'m running into a strange error. I\'ve used Git before on Bitbucket but I just reformatted and now I can\'t seem to get Git to work. After doing a commit, I had to add my email and name to the globals, but then it committed just fine. When I try to use the command git push origin master it doesn\'t work. I get this message: $ git push origin master Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the

git: &#39;credential-cache&#39; is not a git command

一个人想着一个人 提交于 2019-11-26 10:05:40
问题 I followed these instructions to the letter, including the part about password caching. It seems like the instructions are wrong, because every time I git push origin master I get this error: git: \'credential-cache\' is not a git command. See \'get --help\'. ... at which point I am forced to enter my username and password. After doing so, I am presented with the same error message again, followed by the output from git push . Here is the contents of my .gitconfig file: [user] name =