Snippets

Collection of useful command snippets

GNUtils

Grep
 Get next two lines -A n
 Get prev two lines -B n
 Get bordering lines -C n or -A n -B n

cat ~/.ssh/config | grep server -A 2
Host server
    Hostname 192.168.1.2
    user username

SSH
 ssh-copy-id ssh-copy-id -i ~/.ssh/identifyfile user

Git

Switch
Switch to a new locally available branch
 git switch branch
Copy existing unstaged commits to new branch
 git switch -c new_branch

Pull
Pull current branch git pull
Merge remote branch to current branch git pull origin branch

Merge
Abort a merge and start over git merge --abort