Mastering git and github is a critical part of any developer's success. Let's look at some best practices for mastering git/github workflow.
Read: Branches Part 1 (Ry's Git Guide)
- What is the 'working directory' (in context of git)?
- What is the difference between a staged and committed snapshot?
- What are git 'development branches?'
- What is the HEAD?
- How do you create and merge a branch?
- How many different branches do you need?
- Creating a branch (
git checkout -b <branch-name
) - Merging a branch (
git merge <branch-name>
) - Pushing a branch to github (
git push <remote-name> <branch-name>
)
Read: Introducing GitFlow
(^^this article is an example of a GitHub workflow that some professional developers use - it's more complicated of a workflow than we'll need for this project, but it's still good to get an idea of professional workflows)
Commong GitHub best practices:
- Commit often - think of commits as 'checkpoints' in old video games
- Write clear commit messages, and keep them consistent
- Always keep master completely stable (aka 'production ready')
- Create new 'feature' branches for new features
- Always create Pull Requests (aka PRs) instead of just pushing straight to github
- Never merge your own PRs
- Only pull to master branch - never pull to a feature branch
- Install Node GH
gh help
List all available commandsgh help -a
List all available subcommandsgh is
List all issuesgh is '<issue text>'
Open an issuegh is <number> --close
Close an issuegh pr --submit <github-username> --branch '<branch to submit PR to>'
Open a prgh re
open github repo in browser