Skip to content

Latest commit

 

History

History
127 lines (102 loc) · 2.73 KB

README.md

File metadata and controls

127 lines (102 loc) · 2.73 KB

learn-git-in-depth

Course week one all about git

What's git?

git is distributed version control system
Git store thing all in a git object (blob), git store compressed data in a blob with metadata in header and generate this data use SHA1.

Git Commit

Commit is a give information in git any changes up to the current condition, it's a combination from previous commit. Most important in commit:
  • cant change this commit
  • cant edit
  • cant go back
  • cant change the author
  • cant change the date
Because if u edit this commit is gonna have a new SHA1 and have different SHA1

Commit example using tree

  1. img-example-commit
  2. img-metadata-commit

Git Areas

Git have a 3 area:
  1. Working Area
    This file in local area or only in your device (untracked file), in there u can modify your content
  2. Stagging Area
    This area used for thats file are going to be part of the next commit. this area know change between current commit and next commit
  3. Repository
    This area contains all commits and contains all files you have committed in git

Stashing

One more place to store ur code in git without u commit your code. It's useful if you want to switch branches without committing first when you have written code
Commands in git stash:
  1. Command for stashing your code
git stash
  1. Command for how to show your list stash
git stash list
  1. Command for how to show your list stash
git stash list
  1. Command for show your content in your list stash
git stash show stash@{n}
  1. Command for apply ur last stash
git stash apply
  1. Command for apply ur specific stash
git stash apply stash@{n}
  1. Command for stashing untracked files
git stash --include-untracked
  1. Command for stashing all files
git stash --all
  1. Command for delete last stashing and applying change
git stash pop
  1. Command for delete last stash
git stash drop
  1. Command for delete specific stash
git stash drop stash@{n}
  1. Command for delete all stash
git stash clear