Skip to content

Instantly share code, notes, and snippets.

@jbardon
Created November 22, 2018 11:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbardon/b90e6fa384f4e6f58b25d532f361f908 to your computer and use it in GitHub Desktop.
Save jbardon/b90e6fa384f4e6f58b25d532f361f908 to your computer and use it in GitHub Desktop.
Learn git (Medium article)
#!/bin/bash
mkdir learn-git
cd learn-git
# Init repository
git init
touch react.txt
touch vue.txt
git add .
git commit -m'Initial commit'
# Basic path
echo 'React' > react.txt
git status
git add react.txt
git status
git commit -m'Update React file'
echo 'React.js' > react.txt
echo 'Vue.js' > vue.txt
# Can't commit with empty staging
git commit -m'Update React again'
git status
# Only take files from staging
git add react.txt
git status
git commit -m'Update React again'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment