simfish:

Source Control

This configuration installs GNU/Git, the decentralized version control system. The configuration also manages Emacs Magit, a package for interfacing with git.

cover image

Introduction

The key to using git is crafting a good commit. A good commit should do one thing concisely and has to leave the repository in a working state. That's about it.

Commit Messages: the subject-line should describe what changed and why the change was introduced in 50 chars or less. And prefer imperative forms when possible.

if commit is applied, then [insert commit subject-line]This should make real good sense

Git Workflow? All things being equal, choose the simplest workflow. The forking workflow is one example See Forking workflow .

SSH Access: enable SSH protocol with git remote set-url command:

git remote set-url origin  [git@coffee.hub.com:user/path.git]

If you have not already setup an SSH key, one can be generated using the ssh-keygen command.

mkdir -p ~/some/personal/directory
pushd ~/some/personal/directory

#create two SSH keys for the sake of demonestration

ssh-keygen -t ed25519 -C "me@workforcofee"   -f "${HOME}/.ssh/coffee"
# => ~/.ssh/coffee.pub, public key
# => ~/.ssh/coffee,  private key

ssh-keygen -t ed25519 -C "me@workforbeans"   -f "${HOME}/.ssh/beans"
# => ~/.ssh/beans.pub, public key
# => ~/.ssh/beans, private key

# Register the keys on this machine
ssh-add coffee
ssh-add beans

Add the generated keys to ~/.ssh/config Notice, to unregister a given key-file you can run ssh-add -D ~/.ssh/coffee

Host coffee.hub
  HostName coffee.hub.com
  User     git
  IdentityFile ~/.ssh/coffee

Host git.beans
  HostName git.beans
  User git
  IdentityFile ~/.ssh/beans

Customizations

Emacs Key Bindings

(kb::def :states 'normal
      "g"   '(:ignore t        :which-key  "git")
      "gs"  '(magit-status     :which-key  "status")
      "gl"  '(magit-log        :which-keu  "log"))

Packages

magit

Magit is the de-facto standard for integrating git with Emacs

(use-package magit
   :guix (:name emacs-magit)
   :config
     (message "magit config ready!")
   :commands
   (magit-blame-mode
      magit-commit
      magit-log
      magit-status)
   :general
    <<magit-kb>> )

git

Git can be installed from the official GNU/Guix repository.

(specifications->manifest (list "git"))