git-bash

How to npm install with git-bash/mingw32 on win7

主宰稳场 提交于 2019-12-11 09:31:31
问题 I am using git-bash/mingw32 on win7. I am trying to install npm: $ npm install sh: npm: command not found. Git-bash is working normally and is installed correctly. How can I make this work? 回答1: There is a couple of reasons for this behaviour: 1) npm not installed 2) npm not in %PATH% You can add npm to %PATH% by running cmd (win+r -> cmd) as administrator and execute: SET PATH=%PATH%;c:\here\is\path\to\npm\dir After that — try run npm again. 回答2: while installing node.js when click the set

Where is the beginning of the PATH in Git Bash?

本秂侑毒 提交于 2019-12-11 08:23:38
问题 On Windows, the PATH is separated into 2 parts, the System PATH & the User PATH . They can both be displayed and changed in the Control Panel (though not very well). While running msysGit or Git for Windows , a 3rd PATH is created and put before the other 2, meaning programs will look in this 3rd PATH 's folders for a command before the User or System PATH folders. I think msysGit created it because I chose the "Run Git and included Unix tools from the Windows Command Prompt " option during

Git Merging selected branches into a new branch, retaining access to the branches

╄→尐↘猪︶ㄣ 提交于 2019-12-11 04:24:41
问题 What exactly do I type to go from: (I also get a sense from other people that my drawings suggest I don't quite understand git - bear with me.) -<>-<>-<>-<>- (B) / -----master- \ --<>-<>- (A) where '<>' is a commit. to this: (merge A and B into C) --------------o-> (C, new 'clean' branch off master) / / /-<>-<>-<>-<>-/ (B) // / -----master-- / \ / --<>-<>-/ (A) where 'o' is a merge of A and B into C. And will I then still be able to git check-out the branches (A) and (B) ? And/or could I do

Split git diff --name-status by line break

此生再无相见时 提交于 2019-12-11 00:54:05
问题 I'm trying to export a list of changed files from two commits with git, with this command: read -ra ADDR <<< `git diff --name-only HEAD..HEAD~1 | sed -e "s/ /\\\ /g"` for i in "${ADDR[@]}"; do echo "$i" done This works fine. I get a nice list printed out to the terminal with each file on a new row. file1.txt file2.txt file3.txt However, I want to use --name-status instead of --name-only . The reason is so I can later do different things depending on what kind of change was made (e.g. M or D).

How to run two instances of GitBash on Windows 8?

帅比萌擦擦* 提交于 2019-12-10 22:56:58
问题 so I'm going through the onemonthrails online classes, however I've run into a problem. Unlike when using a Mac, It's not possible to create a separate 'tab' to continue working whilst the rails server is running or in general. So I've tried just opening another GitBash window like the tutorial suggests, from the programs/apps menu in Windows 8 (whilst the other one is running) but no luck. Apologies if this is a dumb questions, but am I missing something obvious? 回答1: Once you have a GitBash

How to create and activate virtual environment in windows 10 using bash command

北城以北 提交于 2019-12-10 21:25:48
问题 I am trying to activate my virtual environment using bash command in windows 10. I am using python 3.5.1 . F:\Python\Python35 is the location where my python.exe is located. My virtual environment's name is myvenv and F:\Python\virtualenvironment\myvenv is the location where my virtual environment is located. I created my virtual environment using following bash command Nazem Mahmud@DESKTOP-VQR06GL MINGW64 /f/Python/virtualenvironment $ python -m venv myvenv But i can't activate it now. I

Team City Git “Host key verification failed”

限于喜欢 提交于 2019-12-10 15:54:21
问题 I want to use TeamCity to pull code from a remote Git repo, update a file (and stage and commit to the local repo) and then push the committed file back to the remote repo. The pull & update is fine. If I open git-bash and git push origin master then the commit (arising from the updated file being committed to the local repo) is pushed to the remote repo. Fine. If I try to do this (to the same remote target repo) using a Team City's Command Line runner it fails with [14:49:18][Step 3/7] Host

How to fix “refusing to merge unrelated histories” when uploading project to github?

谁说胖子不能爱 提交于 2019-12-10 15:41:22
问题 I have installed Github desktop and git on windows machine, I got a github account and created a dummy repository. When I intend to upload my package through git bash command line, it fails with error: fatal: refusing to merge unrelated histories I used several ways to overcome this issues by using existing solution from this community, but still didn't fix the problem. Does anyone know any trick of working this problem? How can I upload my projects to github successfully? 回答1: Try the

Trouble running TASKKILL from GitBash

人盡茶涼 提交于 2019-12-10 14:39:52
问题 I'm trying to create a function in my .bashrc to run in gitbash. The command I'm trying to run is: cmd '/C TASKKILL /fi "WINDOWTITLE eq Windows Task Manager"' I'll be changing the "Windows Task Manager" bit, but just to show what I'm trying. The command (TASKKILL /fi "WINDOWTITLE eq Windows Task Manager") works fine when I run it through Windows cmd, but when I run from gitbash, I get this error message: ERROR: Invalid argument/option - 'eq'. Type "TASKKILL /?" for usage. As I said, it works

Ignoring directories in Git repositories on Windows

谁说胖子不能爱 提交于 2019-12-10 12:28:35
问题 How can I ignore directories or folders in Git using msysgit on Windows? 回答1: Create a file named .gitignore in your project's directory. Ignore directories by entering the directory name into the file (with a slash appended): dir_to_ignore/ More information is here. 回答2: By default, Windows Explorer will display .gitignore when in fact the file name is .gitignore.txt . Git will not use .gitignore.txt And you can't rename the file to .gitignore , because Explorer thinks it's a file of type