git-utils 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -6
- data/bin/git-sync-fork +6 -0
- data/lib/git-utils.rb +1 -0
- data/lib/git-utils/sync_fork.rb +21 -0
- data/lib/git-utils/version.rb +1 -1
- data/spec/commands/sync_fork_spec.rb +17 -0
- metadata +8 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc7e18850e6bd2ccc17a911e1884c00df08f8318686ccfd90970a8d6b323f7c2
|
4
|
+
data.tar.gz: 1bc5d574a523470425b0fefc1dcb69e80c58ffb0597cf575c22dfb987332f7d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e63b742743af06a52425ff7d4942740d5abd9e272e502b0593a0864b101022d41e2352ebb435719a400a69d6305c6f8fbc04aac95eb9cfd9f4500914764fc3d2
|
7
|
+
data.tar.gz: 56c86af4c83ac1a1af52cdca22a3386de105d6c00eca53b5dd01b3d9789cdaa6cb725022891b24735a5adf1abae7cab04aaa9ff7756f03e3bddf746bdc599bc7
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Git utilities
|
2
2
|
|
3
|
-
This repo contains some Git utility scripts. The highlights are `git open`, `git pull-request`, `git push-branch`, and `git undo`, which you
|
3
|
+
This repo contains some Git utility scripts. The highlights are `git open`, `git pull-request`, `git push-branch`, and `git undo`, which you’ll never understand how you did without.
|
4
4
|
|
5
5
|
The commands are especially useful when combined with [pivotal-github](https://github.com/mhartl/pivotal-github) gem (which, despite its name, also works with Bitbucket).
|
6
6
|
|
@@ -11,18 +11,19 @@ The `git-utils` used to be pure Bash scripts, but they are now available as a Ru
|
|
11
11
|
## Commands
|
12
12
|
|
13
13
|
* `git amend`: alias for `git commit --amend`
|
14
|
-
* `git bump`: makes a commit with the message "Bump version number"
|
14
|
+
* `git bump`: makes a commit with the message `"Bump version number"`
|
15
15
|
* `git cleanup`: deletes every branch already merged into current branch (apart from `master`, `staging`, `development`, and any branches listed in `~/.git-cleanup-preserved`). Pass the `-r` option to delete remote merged branches.
|
16
16
|
* `git merge-into-branch [branch]`: merges current branch into given branch (defaults to `master`)
|
17
|
-
* `git minor`: makes a commit with the message "Make minor changes"
|
17
|
+
* `git minor`: makes a commit with the message `"Make minor changes"`
|
18
18
|
* `git open`: opens the remote page for the repo (OS X & Linux)
|
19
|
-
* `git polish`: makes a commit with the message "Polish"
|
19
|
+
* `git polish`: makes a commit with the message `"Polish"`
|
20
20
|
* `git pull-request`: pushes the branch and opens the remote page for issuing a new a pull request (OS X only)
|
21
21
|
* `git push-branch`: pushes the current branch up to origin
|
22
22
|
* `git delete-remote-branch <branch>`: deletes the remote branch if it is safe to do so
|
23
23
|
* `git switch <pattern>`: switches to the first branch matching the given pattern
|
24
24
|
* `git sync [branch]`: syncs the given branch with the remote branch (defaults to master)
|
25
|
-
* `git
|
25
|
+
* `git sync-fork`: syncs the `master` branch of a fork with the original upstream `master` (assumes upstream configuration as in “[Configuring a remote for a fork](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/configuring-a-remote-for-a-fork)”)
|
26
|
+
* `git typo`: makes a commit with the message `"Fix typo"`
|
26
27
|
* `git undo`: undoes the last commit
|
27
28
|
* `git graph`: displays full repository history in graphical format; alias for `git log --graph --oneline --decorate --all --full-history --author-date-order --no-notes`
|
28
29
|
|
@@ -81,7 +82,7 @@ The main purpose of `git sync` is to prepare the current branch for merging with
|
|
81
82
|
$ git fetch
|
82
83
|
$ git merge origin/master
|
83
84
|
|
84
|
-
but I don
|
85
|
+
but I don’t like having `master` and `origin/master` be different since that means you have to remember to run `git pull` on `master` some time down the line.)
|
85
86
|
|
86
87
|
## Installation
|
87
88
|
|
data/bin/git-sync-fork
ADDED
data/lib/git-utils.rb
CHANGED
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'git-utils/command'
|
2
|
+
|
3
|
+
class SyncFork < Command
|
4
|
+
|
5
|
+
def parser
|
6
|
+
OptionParser.new do |opts|
|
7
|
+
opts.banner = "Usage: git sync-fork"
|
8
|
+
opts.on_tail("-h", "--help", "this usage guide") do
|
9
|
+
puts opts.to_s; exit 0
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
# Returns a command appropriate for executing at the command line.
|
15
|
+
def cmd
|
16
|
+
c = ["git checkout master"]
|
17
|
+
c << "git fetch upstream"
|
18
|
+
c << "git merge upstream/master"
|
19
|
+
c.join("\n")
|
20
|
+
end
|
21
|
+
end
|
data/lib/git-utils/version.rb
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe SyncFork do
|
4
|
+
|
5
|
+
let(:command) { SyncFork.new }
|
6
|
+
subject { command }
|
7
|
+
|
8
|
+
its(:cmd) { should match /git checkout master/ }
|
9
|
+
its(:cmd) { should match /git fetch upstream/ }
|
10
|
+
its(:cmd) { should match /git merge upstream\/master/ }
|
11
|
+
|
12
|
+
|
13
|
+
describe "command-line command" do
|
14
|
+
subject { `bin/git-sync-fork --debug` }
|
15
|
+
it { should match /git fetch upstream/ }
|
16
|
+
end
|
17
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Hartl
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Add some Git utilities
|
14
14
|
email:
|
@@ -27,6 +27,7 @@ executables:
|
|
27
27
|
- git-push-branch
|
28
28
|
- git-switch
|
29
29
|
- git-sync
|
30
|
+
- git-sync-fork
|
30
31
|
- git-typo
|
31
32
|
- git-undo
|
32
33
|
extensions: []
|
@@ -53,6 +54,7 @@ files:
|
|
53
54
|
- bin/git-push-branch
|
54
55
|
- bin/git-switch
|
55
56
|
- bin/git-sync
|
57
|
+
- bin/git-sync-fork
|
56
58
|
- bin/git-typo
|
57
59
|
- bin/git-undo
|
58
60
|
- git-utils.gemspec
|
@@ -66,6 +68,7 @@ files:
|
|
66
68
|
- lib/git-utils/push_branch.rb
|
67
69
|
- lib/git-utils/switch.rb
|
68
70
|
- lib/git-utils/sync.rb
|
71
|
+
- lib/git-utils/sync_fork.rb
|
69
72
|
- lib/git-utils/version.rb
|
70
73
|
- spec/.DS_Store
|
71
74
|
- spec/commands/.DS_Store
|
@@ -76,6 +79,7 @@ files:
|
|
76
79
|
- spec/commands/pull_request_spec.rb
|
77
80
|
- spec/commands/push_branch_spec.rb
|
78
81
|
- spec/commands/switch_spec.rb
|
82
|
+
- spec/commands/sync_fork_spec.rb
|
79
83
|
- spec/commands/sync_spec.rb
|
80
84
|
- spec/spec_helper.rb
|
81
85
|
homepage: https://github.com/mhartl/git-utils
|
@@ -97,8 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
101
|
- !ruby/object:Gem::Version
|
98
102
|
version: '0'
|
99
103
|
requirements: []
|
100
|
-
|
101
|
-
rubygems_version: 2.7.3
|
104
|
+
rubygems_version: 3.1.2
|
102
105
|
signing_key:
|
103
106
|
specification_version: 4
|
104
107
|
summary: See the README for full documentation
|
@@ -112,5 +115,6 @@ test_files:
|
|
112
115
|
- spec/commands/pull_request_spec.rb
|
113
116
|
- spec/commands/push_branch_spec.rb
|
114
117
|
- spec/commands/switch_spec.rb
|
118
|
+
- spec/commands/sync_fork_spec.rb
|
115
119
|
- spec/commands/sync_spec.rb
|
116
120
|
- spec/spec_helper.rb
|