Course Git & GitHub for Beginners

GitHub Essentials

Collaboration & Workflow Preview

Push your code

gh repo create my-project --public --push\n# or, with a repo already on GitHub:\n\ngit remote add origin https://github.com/you/my-project.git\ngit push -u origin main

The full cycle

git add .\ngit commit -m "…"\ngit pull origin main      # get teammates' work first\ngit push origin main

Pull vs fetch

git fetch origin   # download but don't merge\ngit pull origin main  # fetch + merge

Clone

git clone https://github.com/someone/project.git\ncd project

GitHub features

  • Profile: your repositories and contributions
  • Issues: bug and feature tracking
  • Pull requests: propose and review changes
  • Actions: automated build and test
  • README: the front page of your repo

A good README

# Project name\nShort description\n\n## Features\n- …\n\n## Installation\n```\ngit clone … && npm install\n```\n\n## Usage\n…\n\n## License\nMIT
Tip: git pull before git push, always. It keeps your local history in sync and minimises conflicts.

This is a free preview lesson

Enroll in the Git & GitHub for Beginners to unlock every lesson, lesson PDF guides, quizzes and your certificate - and start creating your own pieces today.


Discussion