News for hackers. Stuff that matters.
Re:Idiot Proof Git by user3939382 on Wednesday November 09, 2022 @11:23AM (#33533861)
.gitconfig:

  [alias]
  add-commit = !git add -A && git commit
.bash_profile:

  function save ()
  {
    git add-commit -m "$*" && git push
  }
Use like:

  $ save This is a commit message
This adds changed files to a commit with this message and pushes it to remote.

Also:

  alias mkpr='git push && gh pr create -d -f -B develop | grep https | xargs printf -- '%s/files' | xargs open'
Open a PR from current branch based on develop and open it in GitHub in my browser.

Merge upstream changes from develop:

  alias mduc='CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) && git checkout develop && git pull && git pull --tags && git checkout ${CURRENT_BRANCH} && git merge develop'
I have a few more, whereby I skip most of the ceremony with git. Works for me.
Re:Idiot Proof Git by afefers on Wednesday November 09, 2022 @01:04PM (#33535479)
Those are really good! Thanks for sharing. Curious to see the others. Are they available somewhere?
Re:Idiot Proof Git by horsawlarway on Wednesday November 09, 2022 @01:37PM (#33535956)
Commit accepts the -A flag. You can simplify it to just

  function save ()
  {
    git commit -am "$*" && git push
  }
Re:Idiot Proof Git by user3939382 on Thursday November 10, 2022 @10:22PM (#33556957)
You can. I have it separate for the purpose of composition, sometimes I do 'gac Foo' which stands for 'git add commit' and I push later.