defunkt-github 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/commands/commands.rb +11 -0
- metadata +1 -1
data/commands/commands.rb
CHANGED
@@ -61,6 +61,17 @@ command :track do |remote, user|
|
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
64
|
+
desc "Fetch from a remote to a local branch."
|
65
|
+
command :fetch do |user, branch|
|
66
|
+
die "Specify a user to pull from" if user.nil?
|
67
|
+
user, branch = user.split("/", 2) if branch.nil?
|
68
|
+
branch ||= 'master'
|
69
|
+
GitHub.invoke(:track, user) unless helper.tracking?(user)
|
70
|
+
|
71
|
+
git "fetch #{user} #{branch}:refs/remotes/#{user}/#{branch}"
|
72
|
+
git_exec "checkout -b #{user}/#{branch} refs/remotes/#{user}/#{branch}"
|
73
|
+
end
|
74
|
+
|
64
75
|
desc "Pull from a remote."
|
65
76
|
flags :merge => "Automatically merge remote's changes into your master."
|
66
77
|
command :pull do |user, branch|
|