Skip to content

Commit 3a94d0a

Browse files
committed
tag verify
1 parent 9ae0052 commit 3a94d0a

File tree

1 file changed

+48
-23
lines changed

1 file changed

+48
-23
lines changed

git-sample-repo-create.sh

Lines changed: 48 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@
1313
# TODO: Get a version that works on Windows
1414

1515
TMP='git-sample-repo'
16-
clear
16+
# clear
17+
echo ""
18+
echo ""
19+
echo ""
20+
echo ""
21+
echo ""
1722
# Make the beginning of run easy to find:
1823
echo "**********************************************************"
1924
echo "******** STEP Delete \"$TMP\" remnant from previous run:"
@@ -22,7 +27,9 @@ mkdir ${TMP}
2227
cd ${TMP}
2328

2429
echo "******** Git version :"
30+
# After "brew install git" on Mac:
2531
git --version
32+
2633
echo "******** STEP Init repo :"
2734
# init without --bare so we get a working directory:
2835
git init
@@ -45,12 +52,15 @@ echo $DEFAULT_BRANCH
4552
# git config branch.develop.remote origin
4653
# git config branch.develop.merge refs/heads/develop
4754

48-
echo "******** STEP Config:"
55+
echo "******** STEP Config (not --global):"
4956
# See https://git-scm.com/docs/pretty-formats :
5057
git config user.name "Wilson Mar"
5158
git config user.email "[email protected]"
52-
# echo "$GIT_COMMITTER_EMAIL=" $GIT_COMMITTER_EMAIL
5359
# echo $GIT_AUTHOR_EMAIL
60+
# echo $GIT_COMMITTER_EMAIL
61+
# gpg --list-keys
62+
git config --global user.signingkey 2E23C648
63+
5464
# Verify settings:
5565
git config core.filemode false
5666

@@ -64,35 +74,38 @@ git config core.editor "~/Sublime\ Text\ 3/sublime_text -w"
6474
git config color.ui auto
6575

6676
# See https://git-scm.com/docs/pretty-formats :
77+
# In Windows, double quotes are needed:
6778
git config alias.l "log --pretty='%Cred%h%Creset %C(yellow)%d%Creset | %Cblue%s%Creset' --graph"
79+
6880
git config alias.s "status -s"
6981
#it config alias.w "show -s --quiet --pretty=format:'%Cred%h%Creset | %Cblue%s%Creset | (%cr) %Cgreen<%ae>%Creset'"
70-
git config alias.w "show -s --quiet --pretty=format:'%Cred%h%Creset | %Cblue%s%Creset'"
82+
git config alias.w "show -s --quiet --pretty=format:'%Cred%h%Creset | %Cblue%s%Creset' %G?"
7183
git config alias.ca "commit -a --amend -C HEAD"
7284

7385
# Have git diff use mnemonic prefixes (index, work tree, commit, object) instead of standard a and b notation:
7486
git config diff.mnemonicprefix true
87+
88+
# Reuse recorded resolution of conflicted merges - https://git-scm.com/docs/git-rerere
7589
git config rerere.enabled false
7690

77-
# Dump config file:
78-
# git config --list
91+
# git config --list # Dump config file
7992

80-
echo "******** STEP commit a1 - README.md :"
93+
echo "******** STEP commit (initial) README :"
8194
touch README.md
8295
git add .
83-
git commit -m "Add README.md"
96+
git commit -m "README.md"
8497
git l -1
8598

86-
echo "******** STEP ammend commit a2 : "
99+
echo "******** STEP amend commit README : "
87100
# ammend last commit with all uncommitted and un-staged changes:
88101
echo "some more">>README.md
89102
# Instead of git commit -a --amend -C HEAD
90103
git ca # use this alias instead.
91104
git l -1
92105

93-
echo "******** STEP ammend commit a3 : "
106+
echo "******** STEP amend commit 2 : "
94107
# ammend last commit with all uncommitted and un-staged changes:
95-
echo "still some more">>README.md
108+
echo "still more">>README.md
96109
# Instead of git commit -a --amend -C HEAD
97110
git ca # use this alias instead.
98111
git l -1
@@ -106,9 +119,18 @@ git reflog
106119
ls -al
107120
cat README.md
108121

109-
echo "******** STEP tag & commit branch F1 : --------------------------"
110-
git tag v1
111-
git checkout v1 -b F1
122+
echo "******** STEP tag :"
123+
# git tag v1 -m"v1 unsigned"
124+
git tag v1 -m"v1 signed" -s
125+
# echo "******** STEP tag verify :"
126+
# git tag -v v1
127+
git verify-tag v1
128+
129+
# echo "******** STEP tag show :"
130+
# git show v1 # Press q to exit scroll.
131+
132+
echo "******** STEP checkout feature1 branch : --------------------------"
133+
git checkout v1 -b feature1
112134
# git branch
113135
ls .git/refs/heads/
114136
git l -1
@@ -127,34 +149,35 @@ git commit -m "Add d"
127149
git l -1
128150
ls -al
129151

130-
echo "******** STEP Merge F1 :"
152+
echo "******** STEP Merge feature1 :"
131153
# Instead of git checkout $DEFAULT_BRANCH :
132154
git checkout @{-1} # checkout previous branch (develop, master)
133155

134-
git merge F1 --no-ff --no-commit # to see what may happen
135-
# git merge F1 --no-ff <:q
136-
git merge F1 -m "merge F1" --no-ff # --no-ff for "true merge".
156+
# git merge --no-ff (no fast forward) for "true merge":
157+
#git merge feature1 --no-ff --no-commit # to see what may happen
158+
git merge feature1 -m "merge feature1" --verify-signatures --no-ff
137159
# resolve conflicts here?
138-
git commit -m "commit merge F1"
160+
git add .
161+
git commit -m "commit merge feature1"
139162
git branch
140163
git l -1
141164

142165
#echo "******** $NOW Remove merged branch ref :"
143-
#git branch -d F1
166+
#git branch -d feature1
144167
#git branch
145168
#git l -1
146169

147170
echo "******** STEP commit: e"
148171
echo "e">>file-e.txt
149172
git add .
150-
git commit -m "e"
173+
git commit -m "Add e"
151174
git l -1
152175

153176
echo "******** STEP commit: f"
154177
echo "f">>file-f.txt
155178
ls -al
156179
git add .
157-
git commit -m "f"
180+
git commit -m "Add f"
158181
git l -1
159182

160183

@@ -206,7 +229,7 @@ NOW=$(date +%Y-%m-%d:%H:%M:%S-MT)
206229
FILENAME=$(echo ${TMP}_${NOW}.zip)
207230
echo $FILENAME
208231
# Commented out to avoid creating a file from each run:
209-
# git archive --format zip --output ../$FILENAME F1
232+
# git archive --format zip --output ../$FILENAME feature1
210233
# ls -l ../$FILENAME
211234

212235

@@ -223,6 +246,8 @@ ls -al
223246

224247

225248

249+
# git reset --hard feature1^
250+
226251
# Undo last commit, preserving local changes:
227252
# git reset --soft HEAD~1
228253

0 commit comments

Comments
 (0)