Gitã®ãµãã³ãã³ãããä½æãã
ãgit mine merged <ãã¼ã¸æ¸ã¿ã®ãã©ã³ãå>ãã¨ãã Git ã®ãµãã³ãã³ããä½æãã¦ã¿ã¾ãããã®ã³ãã³ãã¯ããã¼ã¸æ¸ã¿ã®ãã©ã³ãåãæå®ãã¦ããã©ã³ãã®ååã«mergedãã¤ããã¨ããåç´ãªãã®ã§ãããã㯠Git ã®ãµãã³ãã³ããé«éã«ä½ããããã«ãªãããã®ç·´ç¿ã§ãã
ã¨ãã£ã¦ãã以ä¸ã®å
容ã®ãgit-mineãã¨ããååã§ãã¹ã®éã£ãã¨ããã«é
ç½®ããã ãã§ããGit ã®ãµãã³ãã³ãã®å ´åããã¡ã¤ã«åã¯ããªãã git- ã®ãã¬ãã£ãã¯ã«ãã¾ããç°¡åã§ããã
#!/usr/bin/env ruby # -*- coding: utf-8 -*- require "rubygems" require "thor" class GitMine < Thor include Thor::Actions desc "merged BRANCH_NAME", "rename a branch name, 'name' -> 'merged/name' in Git" def merged(branch_name) if `git branch`.strip.split(/\s+/).grep(branch_name).empty? say "error: not exist branch #{branch_name}" return 1 end cmd = "git branch -M #{branch_name} merged/#{branch_name}" run cmd end end GitMine.start
ããã§ããããããµãã³ãã³ããå¿ è¦ã«ãªã£ãããä¸è¨ã® GitMine ãä¿®æ£ãã¦ã以ä¸ã®ãããªè¨è¿°ã追å ããã° OK ã«ãªãã¾ããç°¡åã§ããã
desc "special", "special command!!" def special say "This is a very special command!!" end
ãã㧠Git ã®ãµãã³ãã³ããé«éã«ä½æã§ããããã«ãªãã¾ããã
--- åèURL
- Homeã»erikhuda/thor Wiki: https://github.com/erikhuda/thor/wiki
--- PRåºå
è¨äºãèªãã§ãã ããããããã¨ããããã¾ãããããããããã°ããã®è¨äºã®èè
ãæä¾ãã¦ããç¡æã®ãµã¼ãã¹ãããã£ã¦ãï¼ããã試ããã ããã
- ããã£ã¦ãï¼: http://cocktailq.herokuapp.com/