-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·49 lines (45 loc) · 1.25 KB
/
Makefile
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
# Makefile for project crud-javascript
# Variabel
REPO = https://github.com/Gopartner/crud-javascript
COMMIT_MSG = "commit pada $(shell date +'%H:%M:%S-%d-%m-%Y')"
# Target: help
help:
@echo "Available targets:"
@echo " 1 : Create a new branch (git branch)"
@echo " 2 : Switch to a branch (git checkout)"
@echo " 3 : View commit log (git log)"
@echo " 4 : Compare local & remote repo (git fetch)"
@echo " 5 : Finishing - Add, commit, and push"
@echo "==============================================="
@echo ""
@echo ""
@read -p "Choose an action (1-5): " choice; \
case $$choice in \
1) \
read -p "Enter new branch name: " branch_name; \
git branch $$branch_name; \
echo "New branch '$$branch_name' created."; \
;; \
2) \
read -p "Enter branch name to switch to: " branch_name; \
git checkout $$branch_name; \
echo "Switched to branch '$$branch_name'."; \
;; \
3) \
git log; \
;; \
4) \
git fetch; \
git status -uno; \
;; \
5) \
git add .; \
git commit -m $(COMMIT_MSG); \
git push -u origin Master; \
echo "Changes committed and pushed with dynamic timestamped commit message."; \
;; \
*) \
echo "Invalid choice. Please choose a number between 1 and 5."; \
;; \
esac
.PHONY: help