Skip to content

Latest commit

 

History

History
64 lines (50 loc) · 1.86 KB

README.md

File metadata and controls

64 lines (50 loc) · 1.86 KB

How to Add, Commit and Push All the Project in PWD to remote GITHUB Repositories

Example:

I have a Projects dir where I have all my projects, and remote git repository is linked to every project. I don't want to navigate to each project dir to push it to remote repository so in this scenario, you can use this shell/bash script to push all the projects to their respective remote repositories at once.

Folder PATH listing
Volume serial number is C80A-3BD9
C:./Projects
├───Project_1
├───Project_2
├───Project_3
└───Project_4

Prerequisite Configuration

You need to configue your git befor using

//add username
git config --global user.name "your_username"

//add email
git config --global user.email "your_email_address@example.com"

//check configuration
git config --global --list

Steps to Execute the Script

  1. Go the the Projects DIR where you have all your projects
  2. Clone the SHELL script using
git clone https://github.com/nidhey27/git-bulk-push-shell-script.git
  1. Copy the push_to_git.sh file to the Root DIR of the Projects where you have all other projects Example:
C:.
│   push_to_git.sh
│
├───Project_1
├───Project_2
├───Project_3
└───Project_4
  1. Now you have your shell script in the root DIR, using the following command to run the script
$ . push_to_git.sh
  1. If the DIR does not have git initilized, then it will ask Do You want to add remote repo? (y/n)
  2. If you choose Y then you will be asked for URL - Enter the remote repo URL alt text
  3. After adding the URL, you are read to go.. alt text