GIT Commit to FTP Site












3















I am working on a project where I only have FTP control of the server. I am basically hand deploying changes from GIT commits to the server.



Is there any way to automate this (without writing the script myself, which I'm about to do), without being able to install git on the server?










share|improve this question























  • You could also push into a local bare repo, and then sync it up on the fs level with any ftpsync tool. It is not an okay solution if the repo on the ftp is used by multiple people.

    – peterh
    Jan 30 at 2:21


















3















I am working on a project where I only have FTP control of the server. I am basically hand deploying changes from GIT commits to the server.



Is there any way to automate this (without writing the script myself, which I'm about to do), without being able to install git on the server?










share|improve this question























  • You could also push into a local bare repo, and then sync it up on the fs level with any ftpsync tool. It is not an okay solution if the repo on the ftp is used by multiple people.

    – peterh
    Jan 30 at 2:21
















3












3








3


2






I am working on a project where I only have FTP control of the server. I am basically hand deploying changes from GIT commits to the server.



Is there any way to automate this (without writing the script myself, which I'm about to do), without being able to install git on the server?










share|improve this question














I am working on a project where I only have FTP control of the server. I am basically hand deploying changes from GIT commits to the server.



Is there any way to automate this (without writing the script myself, which I'm about to do), without being able to install git on the server?







ftp git






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jul 14 '11 at 17:21









Dan RosenstarkDan Rosenstark

3,663114884




3,663114884













  • You could also push into a local bare repo, and then sync it up on the fs level with any ftpsync tool. It is not an okay solution if the repo on the ftp is used by multiple people.

    – peterh
    Jan 30 at 2:21





















  • You could also push into a local bare repo, and then sync it up on the fs level with any ftpsync tool. It is not an okay solution if the repo on the ftp is used by multiple people.

    – peterh
    Jan 30 at 2:21



















You could also push into a local bare repo, and then sync it up on the fs level with any ftpsync tool. It is not an okay solution if the repo on the ftp is used by multiple people.

– peterh
Jan 30 at 2:21







You could also push into a local bare repo, and then sync it up on the fs level with any ftpsync tool. It is not an okay solution if the repo on the ftp is used by multiple people.

– peterh
Jan 30 at 2:21












2 Answers
2






active

oldest

votes


















4














I think what you need is git-ftp. I never tried it, anyway.






share|improve this answer


























  • Thanks, David, that looks quite awesome. I'll check it out.

    – Dan Rosenstark
    Jul 14 '11 at 18:05











  • return if it fixed your problem

    – kokbira
    Jul 14 '11 at 18:17



















3














While I was waiting for answers, I cooked this up. Though now I"ll have to check out git-ftp as David Costa suggests. This script doesn't actually do anything: it just gives you commands for your own FTPing.



#!/usr/bin/env ruby
if __FILE__ == $0
puts "Pulls file list between two git commits and makes ftp commands"
if ARGV.length != 2
puts "Sorry, include two hashes as arguments separated by spaces"
exit
end

hash1 = ARGV[0]
hash2 = ARGV[1]

command = "git log #{hash1}..#{hash2} --name-status --pretty="%p""

results = `#{command}`
results = results.to_a[2..-1].join

lines = results.to_a
lines.each do |line|
modifyAddDelete = line[0..0]
if (modifyAddDelete=="M" || modifyAddDelete=="A")
command = "put"
elsif (modifyAddDelete = "D")
command = "delete"
end
filename = line[2..1000]
puts "#{command} #{filename}"

end

end





share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f310575%2fgit-commit-to-ftp-site%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    4














    I think what you need is git-ftp. I never tried it, anyway.






    share|improve this answer


























    • Thanks, David, that looks quite awesome. I'll check it out.

      – Dan Rosenstark
      Jul 14 '11 at 18:05











    • return if it fixed your problem

      – kokbira
      Jul 14 '11 at 18:17
















    4














    I think what you need is git-ftp. I never tried it, anyway.






    share|improve this answer


























    • Thanks, David, that looks quite awesome. I'll check it out.

      – Dan Rosenstark
      Jul 14 '11 at 18:05











    • return if it fixed your problem

      – kokbira
      Jul 14 '11 at 18:17














    4












    4








    4







    I think what you need is git-ftp. I never tried it, anyway.






    share|improve this answer















    I think what you need is git-ftp. I never tried it, anyway.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Jan 30 at 9:43

























    answered Jul 14 '11 at 17:28









    David CostaDavid Costa

    70149




    70149













    • Thanks, David, that looks quite awesome. I'll check it out.

      – Dan Rosenstark
      Jul 14 '11 at 18:05











    • return if it fixed your problem

      – kokbira
      Jul 14 '11 at 18:17



















    • Thanks, David, that looks quite awesome. I'll check it out.

      – Dan Rosenstark
      Jul 14 '11 at 18:05











    • return if it fixed your problem

      – kokbira
      Jul 14 '11 at 18:17

















    Thanks, David, that looks quite awesome. I'll check it out.

    – Dan Rosenstark
    Jul 14 '11 at 18:05





    Thanks, David, that looks quite awesome. I'll check it out.

    – Dan Rosenstark
    Jul 14 '11 at 18:05













    return if it fixed your problem

    – kokbira
    Jul 14 '11 at 18:17





    return if it fixed your problem

    – kokbira
    Jul 14 '11 at 18:17













    3














    While I was waiting for answers, I cooked this up. Though now I"ll have to check out git-ftp as David Costa suggests. This script doesn't actually do anything: it just gives you commands for your own FTPing.



    #!/usr/bin/env ruby
    if __FILE__ == $0
    puts "Pulls file list between two git commits and makes ftp commands"
    if ARGV.length != 2
    puts "Sorry, include two hashes as arguments separated by spaces"
    exit
    end

    hash1 = ARGV[0]
    hash2 = ARGV[1]

    command = "git log #{hash1}..#{hash2} --name-status --pretty="%p""

    results = `#{command}`
    results = results.to_a[2..-1].join

    lines = results.to_a
    lines.each do |line|
    modifyAddDelete = line[0..0]
    if (modifyAddDelete=="M" || modifyAddDelete=="A")
    command = "put"
    elsif (modifyAddDelete = "D")
    command = "delete"
    end
    filename = line[2..1000]
    puts "#{command} #{filename}"

    end

    end





    share|improve this answer




























      3














      While I was waiting for answers, I cooked this up. Though now I"ll have to check out git-ftp as David Costa suggests. This script doesn't actually do anything: it just gives you commands for your own FTPing.



      #!/usr/bin/env ruby
      if __FILE__ == $0
      puts "Pulls file list between two git commits and makes ftp commands"
      if ARGV.length != 2
      puts "Sorry, include two hashes as arguments separated by spaces"
      exit
      end

      hash1 = ARGV[0]
      hash2 = ARGV[1]

      command = "git log #{hash1}..#{hash2} --name-status --pretty="%p""

      results = `#{command}`
      results = results.to_a[2..-1].join

      lines = results.to_a
      lines.each do |line|
      modifyAddDelete = line[0..0]
      if (modifyAddDelete=="M" || modifyAddDelete=="A")
      command = "put"
      elsif (modifyAddDelete = "D")
      command = "delete"
      end
      filename = line[2..1000]
      puts "#{command} #{filename}"

      end

      end





      share|improve this answer


























        3












        3








        3







        While I was waiting for answers, I cooked this up. Though now I"ll have to check out git-ftp as David Costa suggests. This script doesn't actually do anything: it just gives you commands for your own FTPing.



        #!/usr/bin/env ruby
        if __FILE__ == $0
        puts "Pulls file list between two git commits and makes ftp commands"
        if ARGV.length != 2
        puts "Sorry, include two hashes as arguments separated by spaces"
        exit
        end

        hash1 = ARGV[0]
        hash2 = ARGV[1]

        command = "git log #{hash1}..#{hash2} --name-status --pretty="%p""

        results = `#{command}`
        results = results.to_a[2..-1].join

        lines = results.to_a
        lines.each do |line|
        modifyAddDelete = line[0..0]
        if (modifyAddDelete=="M" || modifyAddDelete=="A")
        command = "put"
        elsif (modifyAddDelete = "D")
        command = "delete"
        end
        filename = line[2..1000]
        puts "#{command} #{filename}"

        end

        end





        share|improve this answer













        While I was waiting for answers, I cooked this up. Though now I"ll have to check out git-ftp as David Costa suggests. This script doesn't actually do anything: it just gives you commands for your own FTPing.



        #!/usr/bin/env ruby
        if __FILE__ == $0
        puts "Pulls file list between two git commits and makes ftp commands"
        if ARGV.length != 2
        puts "Sorry, include two hashes as arguments separated by spaces"
        exit
        end

        hash1 = ARGV[0]
        hash2 = ARGV[1]

        command = "git log #{hash1}..#{hash2} --name-status --pretty="%p""

        results = `#{command}`
        results = results.to_a[2..-1].join

        lines = results.to_a
        lines.each do |line|
        modifyAddDelete = line[0..0]
        if (modifyAddDelete=="M" || modifyAddDelete=="A")
        command = "put"
        elsif (modifyAddDelete = "D")
        command = "delete"
        end
        filename = line[2..1000]
        puts "#{command} #{filename}"

        end

        end






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jul 14 '11 at 18:04









        Dan RosenstarkDan Rosenstark

        3,663114884




        3,663114884






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Super User!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f310575%2fgit-commit-to-ftp-site%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

            Mangá

            Eduardo VII do Reino Unido