Skip to content

Instantly share code, notes, and snippets.

@vin-droid
Last active April 24, 2020 19:06
Show Gist options
  • Save vin-droid/2366665b7a8797df6ff10487afd94f61 to your computer and use it in GitHub Desktop.
Save vin-droid/2366665b7a8797df6ff10487afd94f61 to your computer and use it in GitHub Desktop.

Git Basics:

  • why?
  • what?
  • create a repo
  • adding, staging, commiting files locally
  • gitignore
  • Github, and pushing code to remote repos
  • branching
  • merge, merge conflicts
  • Pull Requests
  • rebase
  • stashing

Commands: (https://www.git-tower.com/blog/git-cheat-sheet/)

  • git init
  • git status
  • git diff
  • git add
  • git commit
  • git log
  • git checkout branch_name
  • git checkout file_name
  • git push
  • git pull
  • git merge
  • git branch
  • git remote
  • git fetch
  • git clone
  • git blame

Questions:

  • How do you reverse the most recent commit?
  • How do you modify the most recent commit? (e.g. add one extra change in a file)
  • How do you stage only some changes of a file that is heavily modified?
  • What is HEAD in git?

Tasks:

  • make a repo with a demo file, push it on github
  • ssh auth setup for github
  • git branchname should show up in console
  • will give a repo, interns should raise PRs with some code changes
  • trunk-based development
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment