From 73b85f9b29c2c06a4ffabcaf0630053c9d2e3c5d Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Wed, 31 Aug 2022 15:44:06 -0400 Subject: [PATCH] Minor tweaks to git cheat sheet --- docs/development/git-cheat-sheet.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/development/git-cheat-sheet.md b/docs/development/git-cheat-sheet.md index 5a53d8da1..35b8e90b5 100644 --- a/docs/development/git-cheat-sheet.md +++ b/docs/development/git-cheat-sheet.md @@ -246,8 +246,12 @@ To https://github.com/netbox-community/netbox Branch 'testing' set up to track remote branch 'testing' from 'origin'. ``` -!!! info - If this branch already exists on the remote repository, `git push` is sufficient. +!!! tip + You can apply the following git configuration to automatically set the upstream for all new branches. This obviates the need to specify `-u origin`. + + ``` + git config --global push.default current + ``` ## The GitHub CLI Client @@ -308,7 +312,7 @@ $ git commit --amend --no-edit ``` !!! danger "Don't Amend After Pushing" - Never amend a commit you've already pushed upstream, as doing so will break the commit tree. Create a new commit instead. + Never amend a commit you've already pushed upstream unless you're **certain** no one else is working on the same branch. Force-pushing will overwrite the change history, which will break any commits from other contributors. When in doubt, create a new commit instead. ### Undo the Last Commit