Skip to content
Steve Wall edited this page Feb 21, 2023 · 7 revisions
#!/bin/bash

pwd
git fetch -a
git commit -am "$1"
git push

### Squash commits

git rebase -i \<SHA\>

Example
commit log
1234143 new commit
3234134 new commit
3423424 last commit from source branch

git rebase -i 3423424

Create a new commit just after 3423424.
In the commit message editor, create a title for the commit, followed by a blank line, and then a verbose commit message.

https://www.atlassian.com/git/tutorials/undoing-changes

Revert a merge

commit 805f2fd0200e19fba7eebd8bed2baa7c47ae43c9 (HEAD -> master, origin/master) Merge: e61b5a7 e657f3c Author: Steve Wall <Steve.Wall@davita.com> Date: Wed Jul 8 09:04:09 2020 -0700

`Merge pull request #20 in JM/master-base-configs from feature/helm-upgrade to master`

`* commit 'e657f3cb7328c7b9265b0a1fe2c87b679d7c7613':`
  `All for Swamy`

DVA-C02VJ22BHTD8:master-base-configs stwall$ git revert 805f2fd0200e19fba7eebd8bed2baa7c47ae43c9 -m 1 [master db0cd91] Revert "Merge pull request #20 in JM/master-base-configs from feature/helm-upgrade to master" 3 files changed, 32 insertions(+), 32 deletions(-) DVA-C02VJ22BHTD8:master-base-configs stwall$ git push Counting objects: 5, done. Delta compression using up to 8 threads. Compressing objects: 100% (5/5), done. Writing objects: 100% (5/5), 825 bytes | 275.00 KiB/s, done. Total 5 (delta 4), reused 0 (delta 0) To ssh://bitbucket.davita.com/jm/master-base-configs 805f2fd..db0cd91 master -> master

Shortcuts

https://bholmes.dev/blog/4-git-shortcuts-that-define-my-workflow/

Clone this wiki locally