Git Bash Review
This is a good enough review of Git Bash terminal commands
ls - list files and folders
ls -l - more details
cd - change directory
*tab - use this for autocompletion
cd ../../.. - 3 levels dows
cd .. - 1 level down
cd ~ - home directory
cd - home directory (no parameters)
cd " " - directly into any directory
echo - display something
echo '$PATH' - variable interpolation, show current path
cat - show content of a file
less - show content, navigable using arrows, press Q to exit
touch - create a file
mv - rename a file, move a file into another name
rm - remove a file
*using touch filename simply modifies the current last access time stamp
mkdir - make directory
mkdir /p - make multilevel directory
rm -r -f - force remove a directory recursively if it is not empty
exit - exit terminal
>> - output to a file
> - output to a file, replace the content
git init - initialize local repo
git config -- global.user
git config -- global.email
git config -- list - list all your configurations
* use Q to escape the listing
touch .gitignore - create an ignore file
*trick $echo "filename" >> .gitignore - move a filename to .gitignore
git add -A - add all unstaged files
git reset "filename" - remove from staging
git reset - reset all staged files
git log - show log
git remote add origin ""
git add . - add all
git commit -m "" - commit files with message (without -m will go to an edit mode)
git push
git push master origin
git remote add origin ""
git add . - add all
git commit -m "" - commit files with message (without -m will go to an edit mode)
git push
git push master origin
Comments
Post a Comment