GWS is a shell script utility for managing multiple Git repositories within a specified root directory. It helps initialize, update, and manage repositories with ease. The script also provides functionalities to run Git commands on these repositories.
- Initialize a new Git workspace
- Update the Git workspace by cloning or pulling repositories
- List all repositories in the current Git workspace
- Run Git commands on repositories in the current directory or the entire workspace
Certainly! Here's the content for your README.md
file without any markdown formatting:
-
Clone the Project:
git clone https://github.com/duyleduc/gws.git
-
Navigate to the Cloned Directory:
cd gws/src
-
Make the Script Executable:
chmod +x gws.sh
-
Create an Alias:
echo "alias gws='$(pwd)/gws.sh'" >> ~/.bashrc
For Zsh users:
echo "alias gws='$(pwd)/gws.sh'" >> ~/.zshrc
-
Reload Your Shell Configuration:
For Bash users:
source ~/.bashrc
For Zsh users:
source ~/.zshrc
-
Initialize a Git Workspace:
gws init
This command scans the current directory and its subfolders for Git repositories and creates a configuration file.
-
Update the Git Workspace:
gws update
This command clones or updates repositories based on the configuration file in the current Git workspace.
-
List Repositories:
gws list
This command lists all repositories and their remote URLs in the current Git workspace.
-
Run Git Commands on Repositories in the Current Directory:
gws -c <git_command>
This command runs the specified Git command on repositories in the current directory.
-
Run Git Commands on All Repositories in the Git Workspace:
gws -g <git_command>
This command runs the specified Git command on all repositories in the Git workspace.
-
Display Script Version:
gws version
This command displays the version of the script.
-
Initialize a Git Workspace:
gws init
-
Update a Git Workspace:
gws update
-
List Repositories:
gws list
-
Run
git status
in the Current Directory:gws -c status
-
Run
git pull
on All Repositories in the Git Workspace:gws -g pull
To update the gws.sh
script, simply pull the latest code from git repository.
cd gws
git pull
This project is licensed under the MIT License - see the LICENSE.md file for details.