Course week one all about 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.
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
Git have a 3 area:
-
Working AreaThis file in local area or only in your device (untracked file), in there u can modify your content
-
Stagging AreaThis area used for thats file are going to be part of the next commit. this area know change between current commit and next commit
-
RepositoryThis area contains all commits and contains all files you have committed in git
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:
- Command for stashing your code
git stash
- Command for how to show your list stash
git stash list
- Command for how to show your list stash
git stash list
- Command for show your content in your list stash
git stash show stash@{n}
- Command for apply ur last stash
git stash apply
- Command for apply ur specific stash
git stash apply stash@{n}
- Command for stashing untracked files
git stash --include-untracked
- Command for stashing all files
git stash --all
- Command for delete last stashing and applying change
git stash pop
- Command for delete last stash
git stash drop
- Command for delete specific stash
git stash drop stash@{n}
- Command for delete all stash
git stash clear