A summary of the main features of Git:
Initializing
Branching
Diffing
Stashing
Undoing
Cleaning Up
Other
Command | Action |
---|---|
git mv [file] |
Move a tracked file |
git tag [tag] [commit ID] |
Create a tag |
git log --all --graph --decorate --oneline |
Display the git log |
+ Enable SSH for GitHub
The main advantage of enabling SSH, rather than just using HTTPS, is that a username and password does not need to be entered for every action.
- Generate a new SSH key:
ssh-keygen -t rsa -b 4096 -C "your_github_email@example.com"
- Start the SSH agent:
eval $(ssh-agent -s)
- Add the private key to the SSH agent:
ssh-add ~/.ssh/id_rsa
- Copy the contents of ~/.ssh/id_rsa.pub (the public key) to the clipboard
- On github.com, Profile Picture -> Settings -> SSH and GPG keys -> New SSH Key -> Paste the key into the Key field and give it an identifying name -> Add SSH Key
- Test the connection:
ssh -T git@github.com
- If this fails, try:
ssh -T -p 443 git@ssh.github.com
- Further info: https://help.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh
- If this fails, try:
- Once access is working, restart all terminals and applications that may wish to use Git via SSH (such as Visual Studio Code).
Note: The SSH agent must be running whenever you want to use SSH (so you may want to add the start-up command to your OS's start-up routines).
+ Further Details
- [https://git-scm.com/docs](Git Documentation)
- [https://www.atlassian.com/git/tutorials/atlassian-git-cheatsheet](Atlassian Git Cheatsheet)
- [https://blog.thoughtram.io/git/rebase-book/2015/02/10/understanding-branches-in-git.html](Understanding Branches in Git)
Move along; nothing to see here...
<script type="text/javascript"> const loadCSS = (filename) => { const file = document.createElement("link"); file.setAttribute("rel", "stylesheet"); file.setAttribute("type", "text/css"); file.setAttribute("href", filename); document.head.appendChild(file); }; const loadJS = (filename) => { const file = document.createElement("script"); file.setAttribute("type", "text/javascript"); file.setAttribute("src", filename); document.head.appendChild(file); }; //just call a function to load your CSS //this path should be relative your HTML location loadCSS("../collapse.css"); loadJS("../collapse.js"); </script> <script type="text/javascript"> var sc_project=12427713; var sc_invisible=1; var sc_security="e81d8d4e"; </script> <script type="text/javascript" src="https://www.statcounter.com/counter/counter.js" async></script>