Skip to content
Heath Brown edited this page Nov 10, 2024 · 5 revisions

Installing Git

Ubuntu

Add latest version of git

sudo add-apt-repository ppa:git-core/ppa
sudo apt update
sudo apt install git

Git basics

Git branch rename

git branch -m master main

Git Credential Manager

git-credential-manager github login

Git worktree

$ git branch | tee
* dev
trunk
$ git worktree add -b hotfix ~/code/hotfix trunk
Preparing ../hotfix (identifier hotfix)
HEAD is now at 62a2daf commit
$ cd ~/code/hotfix
$ sed -i 's/teh/the/' hello.txt
$ git commit --all --message 'urgent hot fix'
$ git push origin HEAD
$ cd ~/code/myproject
git worktree list
/home/seth/code/myproject  15fca84 [dev]
/home/seth/code/hotfix     09e585d [master]

Configuration

#.gitmessage.txt
<type>[optional scope]: <description>

[optional body]

[optonal footer(s)]
ref: https://www.conventionalcommits.org/en/v1.0.0/#specification
[Ticket: X]

Example:

fix: prevent racing of requests

Introduce a request id and a reference to latest request. Dismiss
incoming responses other than from latest request.

Remove timeouts which were used to mitigate the racing issue but are
obsolete now.

Reviewed-by: Z
Refs: #123
git config --global user.name "FirstName LastName"
git config --global user.email email@dot.com
git config --global core.editor vim
git config --global commit.template ~/.gitmessage.txt

References

Clone this wiki locally