-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake-git.mk
More file actions
89 lines (63 loc) · 1.31 KB
/
make-git.mk
File metadata and controls
89 lines (63 loc) · 1.31 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# Git-specific variables
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
branch:
git checkout $(ARGS) > /dev/null 2>&1 || git checkout -b $(ARGS)
staging:
git checkout staging
develop:
git checkout develop
new:
git checkout $(ARGS) || git checkout -b $(ARGS)
stash:
git stash save --keep-index --include-untracked
unstash:
git stash apply
master:
@ git status
history:
git log
push:
git push origin $(BRANCH)
push!:
git push --force origin $(BRANCH)
pull:
git pull origin $(BRANCH)
trunk:
git checkout master
uncommit:
git reset --soft HEAD^
remote:
git remote -v
last-commit:
git log -1 --pretty=%B
# merge feature branch to dev
merge-to:
@ $(eval current_branch := $(BRANCH))
git checkout $(ARGS)
git merge $(current_branch) --no-edit
git push origin $(ARGS)
git checkout $(current_branch)
unmerge:
git merge --abort
branch-reset:
$(eval current_branch := $(BRANCH))
git reset --hard origin/$(current_branch)
pull!:
git pull origin $(BRANCH) --rebase
pull!!: branch-reset
unrebase:
git rebase --abort
fetch:
git fetch
commit:
git commit -m "..."
commit!:
git commit -m "..."
git push origin $(BRANCH)
...:
git add .
git commit -m "..."
git-info:
@echo "=== Git Configuration ==="
@echo "BRANCH: $(BRANCH)"
@echo "GIT_URL: $(shell git remote get-url origin 2>/dev/null)"