@@ -114,12 +114,59 @@ Or you can run the `git update-microsoft-git` command, which will run those brew
114
114
## Linux
115
115
### Ubuntu/Debian distributions
116
116
117
- On newer distributions* , you can download the most recent Debian package from
118
- the [ releases page] ( https://github.com/microsoft/git/releases/latest ) (or
119
- using a tool such as ` wget ` ) then run:
117
+ On newer distributions* , you can install using the most recent Debian package.
118
+ To download and validate the signature of this package, run the following:
120
119
121
120
``` shell
122
- sudo dpkg -i < path to package>
121
+ # Install needed packages
122
+ apt-get install -y curl debsig-verify
123
+
124
+ # Download public key signature file
125
+ curl -s https://api.github.com/repos/microsoft/git/releases/latest \
126
+ | grep -E ' browser_download_url.*msft-git-public.asc' \
127
+ | cut -d : -f 2,3 \
128
+ | tr -d \" \
129
+ | xargs -I ' url' curl -L -o msft-git-public.asc ' url'
130
+
131
+ # De-armor public key signature file
132
+ gpg --output msft-git-public.gpg --dearmor msft-git-public.asc
133
+
134
+ # Note that the fingerprint of this key is "B8F12E25441124E1", which you can
135
+ # determine by running:
136
+ gpg --show-keys msft-git-public.asc | head -n 2 | tail -n 1 | tail -c 17
137
+
138
+ # Copy de-armored public key to debsig keyring folder
139
+ mkdir /usr/share/debsig/keyrings/B8F12E25441124E1
140
+ mv msft-git-public.gpg /usr/share/debsig/keyrings/B8F12E25441124E1/
141
+
142
+ # Create an appropriate policy file
143
+ mkdir /etc/debsig/policies/B8F12E25441124E1
144
+ cat > /etc/debsig/policies/B8F12E25441124E1/generic.pol << EOL
145
+ <?xml version="1.0"?>
146
+ <!DOCTYPE Policy SYSTEM "https://www.debian.org/debsig/1.0/policy.dtd">
147
+ <Policy xmlns="https://www.debian.org/debsig/1.0/">
148
+ <Origin Name="Microsoft Git" id="B8F12E25441124E1" Description="Microsoft Git public key"/>
149
+ <Selection>
150
+ <Required Type="origin" File="msft-git-public.gpg" id="B8F12E25441124E1"/>
151
+ </Selection>
152
+ <Verification MinOptional="0">
153
+ <Required Type="origin" File="msft-git-public.gpg" id="B8F12E25441124E1"/>
154
+ </Verification>
155
+ </Policy>
156
+ EOL
157
+
158
+ # Download Debian package
159
+ curl -s https://api.github.com/repos/microsoft/git/releases/latest \
160
+ | grep " browser_download_url.*deb" \
161
+ | cut -d : -f 2,3 \
162
+ | tr -d \" \
163
+ | xargs -I ' url' curl -L -o msft-git.deb ' url'
164
+
165
+ # Verify
166
+ debsig-verify msft-git.deb
167
+
168
+ # Install
169
+ sudo dpkg -i msft-git.deb
123
170
```
124
171
125
172
Double-check that you have the right version by running these commands,
0 commit comments