Skip to main content

Git (github) cheatsheet

Submitted by admin on
git logo

Push to two repositories at once

git remote set-url       --push origin git@github.com:<username>/<reponame>.git
git remote set-url --add --push origin git@git:/home/git/repos/
git push origin

.

Prevent the remote from accepting destructive changes

Destrictive changes are branch deletions and rewriting history.

cd path-to-repo.git
git config receive.denyNonFastForwards true
git config receive.denyDeletes true

.

Please login to post comments: _TODO