SourceTree uses different git?

Mumpitzmastar August 19, 2012

I installed a git extension named git-ftp.

I want to use this extension everytime i make a pull from a remote repo to push the changes to a remote FTP Server where my private staging webspace is, so that i have the changes from others also over there.

When i make my pull from the command line in terminal, everything is fine, but when i use SourceTree to pull, the output says "git: 'ftp' is not a git command. See 'git --help'." Use of git-ftp is like "git ftp push" to push the changes to FTP.

The git version is changed via preferences to the same version i get if i type in "which git" on the command line. So why ST doesn know "git ftp" and how do i change that?

3 answers

1 accepted

0 votes
Answer accepted
Mumpitzmastar August 28, 2012

Now i found a solution that works. In the Script, i run the command directly with the path where is installed git-ftp. Now it looks like:

~/git-ftp/git-ftp push | tee "post-merge.log"

Where ~/git-ftp/ is the folder i cloned the repository to. With this in my hooks, i get also the correct output inside SourceTree's command line.

0 votes
Mumpitzmastar August 22, 2012

The Hook-Script i wrote gave me some Details. The User that excutes the Script, where the Script is executed and the exit code of the command 'git ftp push'. The User and the path of execution are in both ways the same.

The exit code of the command is 1 if ST trys to execute. The developer told me there is no exit code 1, so it has to be a problem in the way im using git-ftp.

For your information, here is the conversation i had with the dev of git-ftp. https://github.com/resmo/git-ftp/issues/159

stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 22, 2012

Exit code 1 is very common exit code from the shell, for example not being able to find a command. To find out exactly what it means and what is failing, you really need to see the underlying steps and which one produces an error. Do you get that from git-ftp, or is there a way you can make it output more diagnostics (like a -v option)?

Mumpitzmastar August 22, 2012

The Hook-Script contains following lines:

git ftp push -v >> "post-merge.log"
rtrn=$?
if [ $rtrn -ne 0 ]; then
echo "git ftp push failed with exit code $rtrn" >> "post-merge.log"
fi

The output inside the logfile says exit code 1. What ST gives me back was posted in my opening Post.

As i said, from command line everything runs fine. Is also tried a simple script that just runs 'git ftp push' and bind that via custom actions. But it also fails with the same message. "git: 'ftp' is not a git command. See 'git --help'."

stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 22, 2012

Where is the 'ftp' command implementation installed in relation to your system git?

0 votes
stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 19, 2012

If you've already used Preferences > Git to change to the system git then that should mirror what you use on the command line. That is, unless git-ftp uses some a mechanism to function which only works from the command-line.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events