瀏覽代碼

Create a function to cd to a git repo root

DricomDragon 5 年之前
父節點
當前提交
cb02b3c5b2
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      Install/Templates/fish/functions/cdg.fish

+ 5 - 0
Install/Templates/fish/functions/cdg.fish

@@ -0,0 +1,5 @@
+function cdg --description 'Go to root folder of the current Git repository'
+    if set -l GIT_ROOT (git rev-parse --show-toplevel)
+		cd $GIT_ROOT
+	end
+end