Last active
April 17, 2019 21:41
-
-
Save ryanemmm/ccaf9c91b7726812c01906d4555faa43 to your computer and use it in GitHub Desktop.
stuff i always forget and have to google for
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# git: delete local + remote tag | |
git tag -d TagName && git push origin :refs/tags/TagName | |
# git: checkout file from a different branch | |
git checkout <branch_name> -- <paths> | |
http://nicolasgallagher.com/git-checkout-specific-files-from-another-branch/ | |
# vim: find instances of uncommented out console statements | |
search mode / then \(\/\/.*\)\@<!console | |
# vim: copy/paste to clipboard (mac) | |
copy selected part: visually select text(type v or V in normal mode) and type :w !pbcopy | |
copy the whole file :%w !pbcopy | |
paste from the clipboard :r !pbpaste | |
# vim: delete from cursor to <char> | |
```dt<char> #does not include <char>``` | |
```df<char> #includes <char>``` | |
# git: search and replace string in files in repo | |
``` | |
#linux | |
git grep -l 'original_text' | xargs sed -i 's/original_text/new_text/g' | |
#mac | |
git grep -l 'original_text' | xargs sed -i '' -e 's/original_text/new_text/g' | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment