Remotes and GitHub
Publish a small project
Practice the complete fundamentals workflow from an empty folder to a reviewed GitHub branch.
8 minute lesson
Create a disposable project with a README and two content files. You will take it from an empty folder to a reviewed remote branch.
Build the local history first:
- Initialize the repository and verify the current state.
- Commit the README by itself.
- Add one content file in a second focused commit.
- Create
improve-navigation, change the second content file, and commit it. - Switch to
main, inspect the graph, and merge the branch.
Use git status, git diff, git diff --staged, and the graph view throughout. Before every commit, name the exact snapshot in the index.
Now create an empty remote repository. Add it as origin, verify the URL, and push main with an upstream relationship.
Create another branch, make one focused commit, push it, and open a pull request. Review the commit range and three-dot diff before asking anyone else to review it.
Finally, practice recovery in a separate disposable branch:
- Stage two files and unstage one without losing its edits.
- Amend a private commit and observe its new ID.
- Revert a shared practice commit with a normal new commit.
- Attempt to delete an unmerged branch with safe
-dand read the refusal.
Finish by drawing the commit graph. Label HEAD, local branches, and remote-tracking references. If you can explain why each reference points where it does, you understand the Git fundamentals behind the commands.
Lesson completed