Git

Git glossary

Git reference guide

Initialize a repository

echo “# PlateManager” >> README.md
git init
git add README.md
git commit -m “first commit”
git remote add origin git@github.com:mbcladwell/PlateManager.git
git push -u origin master

add/remove tracked files

List tracked files: git ls-tree -r master –name-only

Stop tracking a file: git rm –cached ‘

typical commit/push

git commit -a -m “my message”
git push origin master (push local master to remote origin)

To update work done elsewhere:

(caution - these modify the local files - work may be lost)
git fetch –all
git reset –hard origin/master

to reset the remote repository to local

Useful commands

git remote show origin –to see all branches, location of HEAD
git diff 11bf36c4152befd0b27ded691b 44d68ce7440c0c94e6468a –see the differences between 2 commits
git reflog show HEAD@{now} -10 –show recent activity
git status
git log
git branch -d no-codax-with-gradle –delete a branch
git checkout –switch to a branch

SSL

Find certificate location:
curl-config –ca

Make sure git is referencing certificates:
$ git config –global http.sslCAinfo /etc/ssl/certs/ca-certificates.crt

Update certificates:

bash -c “echo -n | openssl s_client -showcerts -connect www.github.com:443 -servername www.github.com 2>/dev/null | sed -ne ‘/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p’ >> /etc/ssl/certs/ca-certificates.crt”

Share