Stash Work
Remove stash
1 2 3 4 5 |
git stash drop stash@{0} #or git stash clear |
Create stash
1 2 3 4 5 6 7 8 9 |
git stash save "Add stash" #or git stash #or create stash with untracked file git stash save "Add stash" -u |
List all stash
1 |
git stash list |
Restore the stash code
1 |
git stash pop stash@{2} |
Create branch from stash
1 |
git stash branch your_branch stash@{2} |
Clone Repository
1 |
git clone -b 1.0 --single-branch --depth 1 https://github.com/odenktools/titanwall titanwall |
1 |
git clone -b development --single-branch --depth 1 https://github.com/odenktools/titanwall titanwall |
Commit Untracked Files And Folders
1 2 3 |
git add . git commit -am "Add initialize files and folder" git push |
List Untracked files
1 |
git ls-files --others --exclude-standard |
List Modified Files
1 |
git ls-files --modified |
Deleting Untracked Files
1 |
git clean -df |
Commit Modified Files And Folders Only
1 |
git ls-files --modified | xargs git add |
or
1 2 3 |
git add -u git commit -m "Remove files and folder" git push |
If you already have a file checked in, and you want to ignore it
1 2 3 |
git rm -r --cached . git add . git reset HEAD |
Prevent changes from chmod / chown
1 2 3 |
git config --global core.filemode false git config core.filemode false |
Undo add
1 |
git reset yourfilename.txt |
Undo all changes (DANGER)
1 |
git reset |
Create New Shortcut Command
1 2 3 |
git config --global alias.unadd 'reset HEAD --' git config --global alias.po 'push origin --' git config --global alias.pl 'pull origin --' |
1 2 3 |
git unadd file.txt git po develop git pl develop |
Revert All Modified Files
1 |
git diff | git apply --reverse |