Skip to content

Contains instructions and commands for git workshop

Notifications You must be signed in to change notification settings

filipSu/git-workshop

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Git workshop

Instructions and commands for git workshop.

This repo includes aliases.sh file with handy git aliases that are extremely useful when doing things presented in this workshop.

Basics

git pull
git fetch

git status
git diff
git diff --cached

git reset
git reset --hard
git reset --soft HEAD~<number of commits>

git checkout content.txt

Branches and commits

git checkout -b my-new-branch
git checkout master
git checkout -
git add --all
git commit -am "commit message"

Stash

git stash
git stash pop
git stash apply

Logging

git log
git log --oneline | head -n <number of commits>
git log --graph --all
git log --graph --oneline --all

Rebasing

git rebase --onto <commit hash>
git rebase -i HEAD~<number of commits>

Troubleshooting detached HEAD

  1. Checkout other branch => loose all changes
  2. Stash changes, checkout other branch, pop the stash => keep changes
  3. Checkout new branch, commit, push => keep changes and commits

About

Contains instructions and commands for git workshop

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%