Browse Source

Create a function to cd to a git repo root

DricomDragon 5 years ago
parent
commit
cb02b3c5b2
1 changed files with 5 additions and 0 deletions
  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