Skip to content

Change to the SCM root directory from a project subdirectory.

Notifications You must be signed in to change notification settings

gmesser/scmcdroot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

scmcdroot

The commands in this project Search upwards in the directory tree until they find an SCM directory or until they reach the root directory.

scmcdroot - shell script

Change to the SCM root directory of a directory under version control. That is the directory containing the .git, .svn, .bzr, or .p4 directory

Usage:

. scmcdroot

To run the scmcdroot shell script, use '.' (dot), then ' ' (space), then "scmcdroot".

Note:

You must "source" the script so that it runs in the current shell for the directory change to persist when the command ends. If you don't source the script in the current shell, the system will start a new shell and run the script in that shell. The directory will be changed in the new shell, but the directory in your current shell will not be changed. When the new shell finishes running the script, you will be in your original shell, in the directory you were in when you ran the script.

scmwd - shell script

Print the scm working directory, ie. the directory containing the .git, .svn, .bzr, or .p4 directory.

You can change to that directory by executing the following command:

cd `scmwd` 

scmwd.py - Python version of the above shell script.

Print the scm working directory, ie. the directory containing the .git, .svn, .bzr, or .p4 directory.

You can change to that directory by executing the following command:

cd `python scmwd` 

About

Change to the SCM root directory from a project subdirectory.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published