Skip to content

Helpful Git commands

aronasorman edited this page Oct 8, 2014 · 5 revisions

You should clone from your forked repo for this to work:

Set up your upstream remote

git remote add upstream [email protected]:learningequality/ka-lite.git

Update your repo with changes from upstream

BRANCH = branch you want to update

git checkout $BRANCH
git fetch upstream
git merge upstream/$BRANCH

Push your branch to your remote repo on GitHub

git push origin $BRANCH

Push your current branch to a branch that has a different name

git push origin $BRANCH:$DIFFERENT_BRANCH

Restore your working copy to the latest committed version on the current branch

git reset --hard HEAD

Find a string amongst all files tracked by Git

git grep $STRING
Clone this wiki locally