Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introduction to Git & GitHub

Introduction to Git & GitHub

Isaac Oppong Jr

October 05, 2018
Tweet

Transcript

  1. Categories of VCSs • Distributed ◦ Git ◦ Mercurial •

    Centralized ◦ Subversion (SVN) ◦ Concurrent Versions System (CVS)
  2. Git • was created in 2005 by Linus Torvalds (creator

    of the Linux OS Kernel). • is the de facto standard for version control. • has a very strong community support. • Fair experience in Git is a requirement in the industry.
  3. GitHub • was founded in 2008. • provides a web-based

    graphical interface to the Git code repo. • makes it easier to collaborate (on open source projects). • provides a platform to showcase your work. • tracks changes across all versions of your project. • provides a lot of integration options.
  4. Git Basics • Creating a repository (locally & remotely): ◦

    git init ◦ git clone <path to repo> • View the current status of your project: ◦ git status • Staging changes for commit: ◦ git add <filename> ◦ git add . • Committing changes: ◦ git commit -m “Type commit message here” • Pushing changes to remote repository: ◦ git push origin <branch-name>
  5. Branching • Creating a branch ◦ git branch <branch_name> ◦

    git checkout -b <branch_name> • Switching to a branch ◦ git checkout <branch_name> • Merging a branch with another branch (current branch) ◦ git merge <branch_name> • Deleting a branch ◦ git branch -d <branch_name>
  6. Collaborating on Open Source Repositories • Fork the repository in

    question. • Clone the forked repo. • Make changes, commit and push to remote repo. • Create a Pull Request.