can not install git-ftp on windows 8

364 views
Skip to first unread message

mithril

unread,
Oct 12, 2015, 2:46:04 AM10/12/15
to Git for Windows

Newest git-bash installed, but can not install git-ftp.

I follow git-ftp-for-windows:

cd ~
git clone https://github.com/git-ftp/git-ftp git-ftp.git
cd git-ftp.git && chmod +x git-ftp
cp ~/git-ftp.git/git-ftp /bin/git-ftp


But cp: cannot create regular file ‘/bin/git-ftp’: Permission denied

Konstantin Khomoutov

unread,
Oct 12, 2015, 8:39:50 AM10/12/15
to mithril, Git for Windows
On Sun, 11 Oct 2015 23:46:04 -0700 (PDT)
mithril <android...@gmail.com> wrote:

> Newest git-bash installed, but can not install git-ftp.
>
> I follow git-ftp-for-windows
> <http://anantgarg.com/2013/09/25/git-ftp-for-windows/>:
>
> cd ~
> git clone https://github.com/git-ftp/git-ftp git-ftp.git
> cd git-ftp.git && chmod +x git-ftp
> cp ~/git-ftp.git/git-ftp /bin/git-ftp
>
>
> But cp: cannot create regular file ‘/bin/git-ftp’: Permission denied

If you're doing this in a Git Bash window, try running

mount

and you'll see an entry for /bin listed there.
It will supposedly be mapped to something like
C:/Program Files/Git/usr/bin

Now you could see that your user's account supposedly misses the
necessary rights to create a file under a system folder.

You basically have two ways to deal with this issue:

* Continue attacking on the same front, run Git Bash as administrator
and re-try.

* Stop being straightforward, pause for a moment and think what the
call

cp ~/git-ftp.git/git-ftp /bin/git-ftp

is supposed to do.

You'll see that it merely wants to make the script `git-ftp` appear
under the /bin directory (which, on a POSIX system, is really /bin --
not emulated like in Git Bash).

Forgetting for a moment, that copying something under /bin on a POSIX
system is an utterly lame thing in itself, the basic idea this command
tries to convey to the reader is that if script `git-ftp` is
under /bin, is will be callable from the command line without
specifying its full path -- just using its bare name, "git-ftp".

So now you are able to make the next step and just append the full
path of your ~/git-ftp.git/git-ftp to the PATH environment variable to
get the same result.

Or create something like C:\Program Files\git-ftp, put git-ftp under
it and then append "C:\Program Files\git-ftp" to PATH as detailed
above.

Johannes Schindelin

unread,
Oct 12, 2015, 12:10:16 PM10/12/15
to Konstantin Khomoutov, mithril, Git for Windows
Hi,

On 2015-10-12 14:39, Konstantin Khomoutov wrote:
> On Sun, 11 Oct 2015 23:46:04 -0700 (PDT)
> mithril <android...@gmail.com> wrote:
>
>> Newest git-bash installed, but can not install git-ftp.
>>
>> I follow git-ftp-for-windows
>> <http://anantgarg.com/2013/09/25/git-ftp-for-windows/>:
>>
>> cd ~
>> git clone https://github.com/git-ftp/git-ftp git-ftp.git
>> cd git-ftp.git && chmod +x git-ftp
>> cp ~/git-ftp.git/git-ftp /bin/git-ftp
>>
>>
>> But cp: cannot create regular file ‘/bin/git-ftp’: Permission denied
>
> [Good explanation what the *sense* of the followed instructions is]
>
> So now you are able to make the next step and just append the full
> path of your ~/git-ftp.git/git-ftp to the PATH environment variable
> to
> get the same result.
>
> Or create something like C:\Program Files\git-ftp, put git-ftp under
> it and then append "C:\Program Files\git-ftp" to PATH as detailed
> above.

As of 2.6.1, Git for Windows also implicitly adds $HOME/bin to the PATH.
So you can just create the folder "bin" in your home directory and copy
the executable there to make `git ftp` work.

Ciao,
Johannes

mithril

unread,
Oct 12, 2015, 8:56:04 PM10/12/15
to Git for Windows, android...@gmail.com
run Git Bash as administrator solve the problem, thank you very much!
Reply all
Reply to author
Forward
0 new messages