SourceTree uses different git?

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

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.

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.

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.

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)?

The Hook-Script contains following lines:

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

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'."

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

Suggest an answer

Log in or Join to answer
Community showcase
Louis De Jaeger
Posted Thursday in Off-topic

Friday fun: your best joke

Hi all Lets make this Friday fun really fun and post one (or more) of your best jokes! The joke can be about an Atlassian product, or just a really fun joke you want to share! I’m not the best j...

175 views 12 3
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot