-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit-notpushed
More file actions
executable file
·27 lines (25 loc) · 980 Bytes
/
git-notpushed
File metadata and controls
executable file
·27 lines (25 loc) · 980 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
#
# Shows commits you haven't pushed to the remote yet. Accepts same
# arguments as git-log. Assumes 'origin' is the default remote if no
# branch.Foo.remote configuration exists.
curr_branch=$(git symbolic-ref -q HEAD | sed -e 's|^refs/heads/||')
origin=$(git config --get "branch.$curr_branch.remote")
origin=${origin:-origin}
git log $@ $curr_branch ^remotes/$origin/$curr_branch
# def create_branch(branch_name, origin, current_branch)
# cmd = []
# cmd << "git push origin #{current_branch}:refs/heads/#{branch_name}"
# cmd << "git fetch #{origin}"
# cmd << "git branch --track #{branch_name} #{origin}/#{branch_name}"
# cmd << "git checkout #{branch_name}"
# execute_cmd(cmd)
# end
#
# def delete_branch(branch_name, origin, current_branch)
# cmd = []
# cmd << "git push #{origin} :refs/heads/#{branch_name}"
# cmd << "git checkout master" if current_branch == branch_name
# cmd << "git branch -d #{branch_name}"
# execute_cmd(cmd)
# end