Skip to content

Instantly share code, notes, and snippets.

@jparrill
Created July 4, 2019 15:44
Show Gist options
  • Select an option

  • Save jparrill/dec18142140c8dbe5c89698a897ccd28 to your computer and use it in GitHub Desktop.

Select an option

Save jparrill/dec18142140c8dbe5c89698a897ccd28 to your computer and use it in GitHub Desktop.
Git Cheatsheet

Git tips/tricks

Git reset from upstream branch

git remote add upstream /url/to/original/repo
git fetch upstream
git checkout master
git reset --hard upstream/master  
git push origin master --force 

Let the changes for other branch

git stash save
git checkout -b xxx
git stash pop

Clone just a single branch

git clone -b mybranch --single-branch git://sub.domain.com/repo.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment