OOZOU
ติดต่อเรา
Back to TIL
shell

Using Git's aliases feature

13 ตุลาคม 2563

Git allows you to create aliases internally through the config. Your global config should be located here ~/.gitconfig

[alias]
  aliases = !git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /' | sort
  count = shortlog -sn
  l = log
  co = checkout
  ca = commit -C HEAD --amend
  c  = commit
  cm = commit -m
  a  = add
  s  = status
  b  = branch
  p  = push
  mt = mergetool
  dt = difftool
  o  = origin
  rc = rebase --continue
  rs = rebase --skip
  pd  = !git checkout develop && git pull origin develop && git branch --merged | grep -v '*' | grep -v 'master' | xargs git branch -d && git fetch --prune origin
  pm  = !git checkout master && git pull origin master && git branch --merged | grep -v '*' | grep -v 'develop' | xargs git branch -d && git fetch --prune origin
  pr = pull-request -c -m

Most are self explanatory...

git pd (prune develop) - checks out to develop, fetches latest changes, deletes all stale branches except develop (will delete master too)

git pm (prune master) - does the same as prune develop for master

More on shell

shell8 ธันวาคม 2563

Run incognito/private commands for Bash and Zsh

Simply put a space before the command and it won't be saved to ~/.bash\_history. E.g. qrencode -o out.png "Some secret text"

shell22 ตุลาคม 2563

Upgrade postgres database with homebrew

To upgrade postgres you can run

shell13 ตุลาคม 2563

Amazon AWS S3 CLI copy with set perms

Open term (or equivalent) and paste the following:

มีโปรเจกต์ในใจ?

เรายินดีรับฟังสิ่งที่คุณกำลังสร้าง

เริ่มต้นสนทนาhello@oozou.com
OOZOU Logo

กรุงเทพฯ · สิงคโปร์ · ฮ่องกง

X
Facebook
Instagram
LinkedIn

บริการ

  • พัฒนาเว็บ
  • AI และ Generative AI
  • พัฒนาแอปมือถือ
  • การวิเคราะห์และวิศวกรรมข้อมูล
  • ออกแบบ UI/UX และผลิตภัณฑ์
  • การเปลี่ยนแปลงทางดิจิทัล

บริษัท

  • เกี่ยวกับเรา
  • ร่วมงานกับเรา
  • บล็อก
  • เอกสารวิชาการ
  • กรณีศึกษา
  • Today I Learned
  • ติดต่อเรา

เพิ่มเติม

  • อุตสาหกรรม
  • ขอใบเสนอราคา
  • เครือข่ายพันธมิตร
© 2026 OOZOU สงวนลิขสิทธิ์
นโยบายความเป็นส่วนตัวจรรยาบรรณนโยบาย ABAC