Format all files in src
:
prettier --config .prettierrc --write "src/**/*.js"
Or, more generally:
prettier --config <path-to-config> --write "<source-path>/**/*.js"
Note that the quotes are required for the recursion to work correctly.
Merge a branch ready to be reviewed:
git merge --squash --no-commit <branch-name>
Delete unnecessary branch:
git push origin --delete <branch_name> # Delete from server
git branch -d <branch_name> # Delete locally
Forgetting commits:
git reset --hard HEAD^ # Forget most recent
git reset --hard HEAD~2 # Forget last 2 commits (etc)
Change origin of your branch (eg to a fork)
git remote --set-url origin <your git clone URL>
On the source:
git daemon --base-path=. --export-all --enable=receive-pack --reuseaddr --informative-errors --verbose
On the destination:
git clone git://<ip-address>/repo-name
git pull
Show the diff of the most recent stash:
git stash show -p
Comment lines containing log
:
:g/log/s/^/\/\/
or more generally:
:g/<pattern>/s/^/<comment-string>
Saving over a read-only file
:w !sudo tee %
From man man
or man man-pages
or man manpages
, depending on your system
The following conventions apply to the SYNOPSIS section and can be used
as a guide in other sections.
bold text type exactly as shown.
italic text replace with appropriate argument.
[-abc] any or all arguments within [ ] are optional.
-a|-b options delimited by | cannot be used together.
argument ... argument is repeatable.
[expression] ... entire expression within [ ] is repeatable.