git_remote_branch 0.3.5 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +1 -2
- data/Gemfile +1 -1
- data/README.rdoc +35 -15
- data/etc/grb-completion.bash +47 -0
- data/lib/version.rb +1 -1
- metadata +5 -4
data/.gitignore
CHANGED
data/Gemfile
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
source
|
1
|
+
source 'https://rubygems.org'
|
2
2
|
gemspec
|
data/README.rdoc
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
== Why git_remote_branch?
|
2
2
|
|
3
3
|
git_remote_branch is a simple command-line tool that makes it very easy to manipulate
|
4
4
|
branches published in shared repositories.
|
@@ -15,17 +15,37 @@ Note: git_remote_branch assumes that the local and remote branches have the
|
|
15
15
|
same name. Multiple remote repositories (or origins) are supported.
|
16
16
|
|
17
17
|
|
18
|
-
|
18
|
+
== Installation
|
19
19
|
|
20
20
|
gem install git_remote_branch
|
21
21
|
|
22
|
+
If you use RVM, you may want to automatically install it on all rubies
|
23
|
+
you'll install in the future:
|
24
|
+
|
25
|
+
echo git_remote_branch >> ~/.rvm/gemsets/global.gems
|
26
|
+
|
22
27
|
If you're on Windows, you can optionally install the following gems, to get
|
23
28
|
color output:
|
24
29
|
|
25
30
|
gem install windows-pr win32console
|
26
31
|
|
32
|
+
=== Auto-completion
|
33
|
+
|
34
|
+
If you use zsh with {oh-my-zsh}[https://github.com/robbyrussell/oh-my-zsh],
|
35
|
+
you can have grb auto-completion by using the {git-remote-branch plugin}[https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/git-remote-branch].
|
36
|
+
|
37
|
+
# ~/.zshrc
|
38
|
+
plugins=(git git-remote-branch ...)
|
39
|
+
|
40
|
+
If you use bash, you can have grb auto-completion by souring `etc/grb-completion.bash`
|
41
|
+
|
42
|
+
# ~/.bash_profile (after your Ruby has been set, e.g. after the RVM snippet)
|
43
|
+
|
44
|
+
grbc=`gem contents git_remote_branch | grep grb-completion.bash` && source $grbc
|
45
|
+
|
46
|
+
or copy it to your desired destination and source it.
|
27
47
|
|
28
|
-
|
48
|
+
== Usage
|
29
49
|
|
30
50
|
Notes:
|
31
51
|
- parts between brackets are optional
|
@@ -38,7 +58,7 @@ Available commands (with aliases):
|
|
38
58
|
|
39
59
|
$ grb [-h|help] #=> Displays help
|
40
60
|
|
41
|
-
|
61
|
+
==== create (alias: new)
|
42
62
|
|
43
63
|
Create a new local branch as well as a corresponding remote branch based on the
|
44
64
|
branch you currently have checked out.
|
@@ -47,7 +67,7 @@ Track the new remote branch. Checkout the new branch.
|
|
47
67
|
$ grb create branch_name [origin_server]
|
48
68
|
|
49
69
|
|
50
|
-
|
70
|
+
==== publish (aliases: remotize, share)
|
51
71
|
|
52
72
|
Publish an existing local branch to the remote server.
|
53
73
|
Set up the local branch to track the new remote branch.
|
@@ -55,7 +75,7 @@ Set up the local branch to track the new remote branch.
|
|
55
75
|
$ grb publish branch_name [origin_server]
|
56
76
|
|
57
77
|
|
58
|
-
|
78
|
+
==== delete (aliases: destroy, kill, remove, rm)
|
59
79
|
|
60
80
|
Delete the remote branch then delete the local branch.
|
61
81
|
The local branch is not deleted if there are pending changes.
|
@@ -63,14 +83,14 @@ The local branch is not deleted if there are pending changes.
|
|
63
83
|
$ grb delete branch_name [origin_server]
|
64
84
|
|
65
85
|
|
66
|
-
|
86
|
+
==== track (aliases: follow grab fetch)
|
67
87
|
|
68
88
|
Track an existing remote branch locally and checkout the branch.
|
69
89
|
|
70
90
|
$ grb track branch_name [origin_server]
|
71
91
|
|
72
92
|
|
73
|
-
|
93
|
+
==== rename (aliases: rn mv move)
|
74
94
|
|
75
95
|
Rename a remote branch and its local tracking branch.
|
76
96
|
The branch you want to rename must be checked out.
|
@@ -79,7 +99,7 @@ The branch you want to rename must be checked out.
|
|
79
99
|
$ grb rename new_branch_name [origin_server]
|
80
100
|
|
81
101
|
|
82
|
-
|
102
|
+
==== explain
|
83
103
|
|
84
104
|
All commands can be prepended by the word 'explain'. Instead of executing the
|
85
105
|
command, git_remote_branch will simply output the list of commands you need to
|
@@ -110,7 +130,7 @@ Explain your specific case:
|
|
110
130
|
|
111
131
|
This, of course, works for each of the grb commands.
|
112
132
|
|
113
|
-
|
133
|
+
== More on git_remote_branch
|
114
134
|
|
115
135
|
- {Documentation}[http://rubydoc.info/gems/git_remote_branch/0.3.3/frames]
|
116
136
|
- {Code}[https://github.com/webmat/git_remote_branch]
|
@@ -118,12 +138,12 @@ This, of course, works for each of the grb commands.
|
|
118
138
|
- News at {Mathieu Martin's blog}[http://programblings.com]
|
119
139
|
|
120
140
|
|
121
|
-
|
141
|
+
=== History
|
122
142
|
|
123
143
|
git_remote_branch in its current form was inspired by a script created by Carl Mercier and made public on his blog: {No nonsense GIT, part 1: git-remote-branch}[http://blog.carlmercier.com/2008/01/25/no-nonsense-git-part-1-git-remote-branch/]
|
124
144
|
|
125
145
|
|
126
|
-
|
146
|
+
=== Contributors
|
127
147
|
|
128
148
|
- {Mathieu Martin}[http://www.programblings.com]
|
129
149
|
- {Ivan}[https://github.com/toy]
|
@@ -132,17 +152,17 @@ git_remote_branch in its current form was inspired by a script created by Carl M
|
|
132
152
|
- {Carl Mercier}[https://github.com/cmer]
|
133
153
|
|
134
154
|
|
135
|
-
|
155
|
+
=== Legalese
|
136
156
|
|
137
157
|
git_remote_branch is licensed under the MIT License. See the file LICENSE for details.
|
138
158
|
|
139
|
-
|
159
|
+
==== Supported platforms
|
140
160
|
|
141
161
|
This version of git_remote_branch has been tested with
|
142
162
|
|
143
163
|
- OS X Mountain Lion
|
144
164
|
- past versions were known to work on Linux and Windows
|
145
|
-
- Ruby 1.
|
165
|
+
- Ruby 1.9.3
|
146
166
|
- git 1.7+
|
147
167
|
|
148
168
|
Let me know if you encounter problems running git_remote_branch with your platform.
|
@@ -0,0 +1,47 @@
|
|
1
|
+
_grb()
|
2
|
+
{
|
3
|
+
local cur=${COMP_WORDS[COMP_CWORD]}
|
4
|
+
local verb=${COMP_WORDS[1]}
|
5
|
+
|
6
|
+
local position=${COMP_CWORD}
|
7
|
+
|
8
|
+
if [[ "$verb" == "explain" ]]; then
|
9
|
+
let "position = $position - 1"
|
10
|
+
fi
|
11
|
+
|
12
|
+
case "$position" in
|
13
|
+
1)
|
14
|
+
COMPREPLY=( $(compgen -W "help explain create new delete destroy kill remove rm rename rn mv move track follow grab fetch" -- $cur) )
|
15
|
+
;;
|
16
|
+
2)
|
17
|
+
|
18
|
+
COMPREPLY=( $(compgen -W "$(_grb_branch)" -- $cur))
|
19
|
+
;;
|
20
|
+
3)
|
21
|
+
|
22
|
+
COMPREPLY=( $(compgen -W "$(_grb_remotes)" -- $cur))
|
23
|
+
;;
|
24
|
+
esac
|
25
|
+
}
|
26
|
+
|
27
|
+
_grb_branch()
|
28
|
+
{
|
29
|
+
{
|
30
|
+
git for-each-ref refs/remotes --format="%(refname:short)" |
|
31
|
+
grep -v HEAD |
|
32
|
+
sed 's/^.*\///g';
|
33
|
+
git for-each-ref refs/heads --format="%(refname:short)";
|
34
|
+
} | sort | uniq
|
35
|
+
}
|
36
|
+
|
37
|
+
_grb_remotes()
|
38
|
+
{
|
39
|
+
local i IFS=$'\n'
|
40
|
+
for i in $(git config --get-regexp 'remote\..*\.url' 2>/dev/null); do
|
41
|
+
i="${i#remote.}"
|
42
|
+
echo "${i/.url*/}"
|
43
|
+
done
|
44
|
+
}
|
45
|
+
|
46
|
+
complete -F _grb grb
|
47
|
+
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git_remote_branch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-
|
13
|
+
date: 2013-09-20 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rake
|
@@ -157,6 +157,7 @@ files:
|
|
157
157
|
- Rakefile
|
158
158
|
- bin/git-remote-branch
|
159
159
|
- bin/grb
|
160
|
+
- etc/grb-completion.bash
|
160
161
|
- git_remote_branch.gemspec
|
161
162
|
- lib/constants.rb
|
162
163
|
- lib/git_remote_branch.rb
|
@@ -197,7 +198,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
197
198
|
version: '0'
|
198
199
|
segments:
|
199
200
|
- 0
|
200
|
-
hash:
|
201
|
+
hash: -3102393032181836820
|
201
202
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
202
203
|
none: false
|
203
204
|
requirements:
|
@@ -206,7 +207,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
206
207
|
version: '0'
|
207
208
|
segments:
|
208
209
|
- 0
|
209
|
-
hash:
|
210
|
+
hash: -3102393032181836820
|
210
211
|
requirements: []
|
211
212
|
rubyforge_project:
|
212
213
|
rubygems_version: 1.8.25
|