This week as a part of the Full Stack Apprenticeship at Sparkbox, we focused on becoming very comfortable with Git. Here is a list of things I learned this week.
- Using the merge button on GitHub makes commit history hard to read.
- Instead of merging, use
git rebase. Rebasing will put the branch you want to merge on top of the master branch and add it to the end.
- A SHA (a long line of characters associated with a commit message) refers to changes and the parent of a working directory. If the parent changes, the SHA will change.
- Fast forward(
--ff) will take the master branch and point to the next commit.
--ff-onlywill only do the action if fast forward is possible.
- Bare git repositories are repositories with no working directory.
- Verified commits are commits cryptographically changed by the committer. You can give someone your public GPG key, and they can check that the commit was made using your computer.
- You can have a different GPG key per device you are using to push to GitHub.
- If your commits are not verified, other people can impersonate you.
- SSH stands for secure shell. It's a secure way to access a computer over an unsecured network.
- You can have more than one SSH and GPG key added to your GitHub account.
- SSH will not verify your commits; only GPG will.
- gitK is a built-in tool used to view Git commit history.
- When you submit a pull request, it will be for your entire branch. You do not need to submit multiple pull requests for different commits on the same branch.
Things I learned outside of Git this sprint:
- NVM is a Node version manager and will enable you to switch between different versions of Node if you have more than one installed.
- Netlify is an excellent, easy way to deploy static websites. They let you import directories directly from GitHub.
Awesome resources from this week: