how to git pull all projects in a folder 1

how to git pull all projects in a folder

find . -type d -depth 1 -exec echo git --git-dir={}/.git --work-tree=$PWD/{} status \;

Here is what the above code is Doing:
1. Find all directories in the current directory (.)
2. Filter out all directories that are not depth 1 (i.e. not in the current directory)
3. Execute the command echo git –git-dir={}/.git –work-tree=$PWD/{} status \;

The {} is a placeholder for the directory that is found.

The $PWD is a variable that contains the current directory.

The \; is the end of the command.

The echo is there so that you can see what the command is doing.

If you want to actually execute the command, remove the echo.

Similar Posts