I am trying to create a file that I can run from the command line:
export gorepo="cd /home/pol/dcu/practicum/gitrep"
Then in an executable file on $PATH
#!/bin/bash gorepo # gorepo is defined in .bashrc git checkout
I've tried various combinations of export, alias and using shell variables and bash functions to no avail - I'm at my wit's end!
How do I create a command that will simply cd into my repo and then run git checkout and return me to the shell in the repo directory?