Some extra techniques for using GIT
y
adds a blockn
ignores a blockq
ends this-p
sessione
allows the dev to edit the current block (will give instructions when the dev does this)- delete lines beginning
+
to stop them being added to the commit - remove the
-
from lines to stop them being deleted
- delete lines beginning
set up a config
file in the ~/.ssh
folder:
Host [email protected]:darkest-star/site.git
IdentityFile ~/.ssh/id_rsa_darkeststar
IdentitiesOnly yes
# fix for virgin from https://stackoverflow.com/a/52817036/617603
Host github.com
Hostname ssh.github.com
Port 443
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa_overbyte
use git config user.email='[email protected]'
within a project to change the user
email for that project. If that email is associated to another account, the
commit will be credited to them
use
git for-each-ref --format '%(refname:short)' refs/heads | grep -v "master\|main\|develop" | xargs git branch -D
notes:
for-each-ref
allows a loop over all of the branches'%(refname:short)'
gives the terse branch name- this is piped into
grep -v
(inverted search) to remove any references in the list (master
,main
ordevelop
in this case) - the result is piped into
xargs
to execute a delete on the git branch name