Git is an open source distributed version control system that is the most widely used by software developers today. Its decentralized nature makes it essentially censorship-proof and very robust against accidental deletion or permanent loss of work. Even if somebody accidentally deletes the remote repository entirely, each member of the team has a full version of the project and can just create another one.
In this video, we install Git on a mostly fresh copy of Ubuntu 24.04 (with Visual Studio Code installed). Because we want to use Git with GitHub and get that sweet-sweet Verified tag on our commits, we install git along with the dependencies needed for git-credential-libsecret:
`sudo apt install make gcc git libsecret-1-0 libsecret-1-dev libglib2.0-dev`
After installing Git, we do some basic global configuration, (including enabling rerere, you'll thank me later), create a GPG signing key, upload that signing key to GitHub, and create a GitHub access token with repo access.
We use git-credential-libsecret to improve security so we don't have the access token stored in plain text somewhere on the hard drive.
This video covers:
00:00:00 Introduction and overview of Git
00:03:41 Install Git along with libsecret dependencies
00:04:53 Post install verification and initial global config setup
00:07:50 Create a basic local repo to make sure local committing works
00:10:40 Set up GPG key so commits can be signed.
00:16:04 Add the GPG key to the GitHub account
00:18:11 Configure git-credential-libsecret as the credential helper
00:19:56 Generate a GitHub access token
00:22:33 Clone a remote repo and create a commit on a throwaway branch to test the token and signature
00:25:20 Copy the generated access token and use it to authenticate when pushing
00:26:11 Look in GitHub to ensure the commit shows as verified and then remove the throwaway branch from the remote.
00:27:43 Review the option to always sign commits `git config [--global] commit.gpgsign true`
00:29:14 Closing comments
#setup #configuration #install #linux #ubuntu #debian #deb #terminal #ubuntu24 #lts #github #code #visualstudiocode #vscode #apt #git #libsecret #gpg #verifiedcommit #rerere #versioncontrol #sourcecodemanagement #scm
See other related StatelessCode videos:
Install Visual Studio Code on Ubuntu 24.04 • Install Visual Studio Code on Ubuntu 24.04
Set up a GitHub Profile README for an Organization • Set up a GitHub Profile README for an Orga...
Install Ubuntu 24.04 LTS Desktop • Install Ubuntu 24.04 LTS Desktop
Featured Playlist:
Ruby on Rails NerdDice.com • Ruby on Rails: NerdDice.com
Resources that we relied upon for this solution:
Git homepage https://git-scm.com/
GitHub: Managing commit signature verification https://docs.github.com/en/authentica...
Storing your GIT credentials in libsecret https://gist.github.com/JonasGroeger/...
Git Tools - Rerere https://git-scm.com/book/en/v2/Git-To...
This video is CC0 - No rights reserved. (YouTube doesn't allow this option when publishing.) All code is released under the UNLICENSE. Stateless Code denies the concept of "intellectual property". Copying is not stealing.