git: 'flow' 不是 git 命令。见'git --help'
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10779901/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
git: 'flow' is not a git command. See 'git --help'
提问by Jeffrey L. Roberts
I just tried to install git-flow, however, it does not seem to be integrated properly with git, what can I do to integrate gitflow with git? is there a way I can do this manually?
我只是尝试安装 git-flow,但是,它似乎没有与 git 正确集成,我该怎么做才能将 gitflow 与 git 集成?有没有办法可以手动执行此操作?
Thank you, Jeffrey
谢谢你,杰弗里
[root@sa 2]# wget --no-check-certificate -q -O - https://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sudo bash
### gitflow no-make installer ###
Installing git-flow to /usr/local/bin
Cloning repo from GitHub to gitflow
Cloning into gitflow...
remote: Counting objects: 2362, done.
remote: Compressing objects: 100% (957/957), done.
remote: Total 2362 (delta 1406), reused 2238 (delta 1316)
Receiving objects: 100% (2362/2362), 484.60 KiB, done.
Resolving deltas: 100% (1406/1406), done.
Updating submodules
Submodule 'shFlags' (git://github.com/nvie/shFlags.git) registered for path 'shFlags'
Cloning into shFlags...
remote: Counting objects: 454, done.
remote: Compressing objects: 100% (55/55), done.
Receiving objects: 100% (454/454), 101.19 KiB, done.
Resolving deltas: 100% (389/389), done.
remote: Total 454 (delta 389), reused 454 (delta 389)
Submodule path 'shFlags': checked out '2fb06af13de884e9680f14a00c82e52a67c867f1'
removed `/usr/local/bin/git-flow'
`gitflow/git-flow' -> `/usr/local/bin/git-flow'
removed `/usr/local/bin/git-flow-init'
`gitflow/git-flow-init' -> `/usr/local/bin/git-flow-init'
removed `/usr/local/bin/git-flow-feature'
`gitflow/git-flow-feature' -> `/usr/local/bin/git-flow-feature'
removed `/usr/local/bin/git-flow-hotfix'
`gitflow/git-flow-hotfix' -> `/usr/local/bin/git-flow-hotfix'
removed `/usr/local/bin/git-flow-release'
`gitflow/git-flow-release' -> `/usr/local/bin/git-flow-release'
removed `/usr/local/bin/git-flow-support'
`gitflow/git-flow-support' -> `/usr/local/bin/git-flow-support'
removed `/usr/local/bin/git-flow-version'
`gitflow/git-flow-version' -> `/usr/local/bin/git-flow-version'
removed `/usr/local/bin/gitflow-common'
`gitflow/gitflow-common' -> `/usr/local/bin/gitflow-common'
removed `/usr/local/bin/gitflow-shFlags'
`gitflow/gitflow-shFlags' -> `/usr/local/bin/gitflow-shFlags'
[root@sa 2]# git flow
git: 'flow' is not a git command. See 'git --help'.
Did you mean one of these?
reflog
show
采纳答案by Peter van der Does
As mentioned in the comments, most likely /usr/local/bin
isn't set in $PATH
. Check it by doing echo $PATH
, and if it doesn't show /usr/local/bin
, add it to $PATH
.
正如评论中提到的,很可能/usr/local/bin
没有设置在$PATH
. 通过执行检查它echo $PATH
,如果没有显示/usr/local/bin
,请将其添加到$PATH
.
回答by clinical
Remove git-flow and install it manually.
删除 git-flow 并手动安装。
On Linux:
在 Linux 上:
sudo apt-get remove git-flow && wget --no-check-certificate -q -O - https://raw.github.com/nvie/gitflow/develop/contrib/gitflow-installer.sh | sudo bash
On Windows
在 Windows 上
If you work with cygwin make sure util-linux and wget are installed. Then run this with cygwin:
如果您使用 cygwin,请确保已安装 util-linux 和 wget。然后用 cygwin 运行它:
wget -q -O - --no-check-certificate github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | bash
For further information check the project page on github
回答by Khub Ram Bhardwaj
I had this issue on Windows 10 (SourceTree).
I added following folder to PATH variable in "Environment variables for user"
我在 Windows 10 (SourceTree) 上遇到了这个问题。
我在“用户的环境变量”中将以下文件夹添加到 PATH 变量
%USERPROFILE%\AppData\Local\Atlassian\SourceTree\git_local\usr\bin
I closed and reopened the SourceTree - and the issue was fixed.
我关闭并重新打开 SourceTree - 问题已解决。