1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Minor tweaks to git cheat sheet

This commit is contained in:
jeremystretch
2022-08-31 15:44:06 -04:00
parent 301ebe0da3
commit 73b85f9b29

View File

@ -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