Search GH for strings within specific file names


Github has a LOT of code repositories. Sometimes, you want to search for how someone does a task in a specific, well-known file name for a project. For example, all Rails apps have a Gemfile, maybe you want to find a version of a gem used in a Gemfile.

Combine Github search filters to find exactly what you need.

# search for the word "command" in all files named "app.yml"
command in:file filename:app.yml

Sync a github forked repo


Forking a github repo inherently takes it out of the originating repo flow. Sync it back this way.

# check your remotes
git remote -v
# origin (fetch)
# origin (push)
# add the remote
git remote add upstream
# note, the original docs assume you don't have a github account set up properly.  If not, do this one:
# git remote add upstream
# and confirm
git remote -v
# might look like this:
# origin (fetch)
# origin (push)
# upstream (fetch)
# upstream (push)
# get the changes from the originating repo
git fetch upstream
# check out the master branch to sync to
git checkout master
# and sync away
git merge upstream/master
# then back to your branch and continue
git co this-is-my-branch
git rebase master
git push --force origin this-is-my-branch
# etc.