Skip to content

Instantly share code, notes, and snippets.

@ryanemmm
Last active April 17, 2019 21:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanemmm/ccaf9c91b7726812c01906d4555faa43 to your computer and use it in GitHub Desktop.
Save ryanemmm/ccaf9c91b7726812c01906d4555faa43 to your computer and use it in GitHub Desktop.
stuff i always forget and have to google for
# 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