1

I know there are instructions to install gitsubrepo in Git for windows here.

I understand what I have to do, however, I do not know where to find the shell startup script. I have installed the Git Bash shell, and I am at a loss for where its shell startup script is located.

Does anyone know where the startup script is?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
wiyosaya
  • 95
  • 9

1 Answers1

2

As long as:

  • git is in your $PATH
  • git subrepo .rc file has been added to your .bashrc (source /path/to/git-subrepo/.rc' >> ~/.bashrc, done from a git bash session)

You can use a regular git-bash shell, and start typing git subrepo commands.

The "shell startup configuration" is the .rc file which is where you have cloned the repository (in /c/path/to/your/git-subrepo/clone within a git bash session)

If you clone in C:\Users\Me\git-subrepo, you would need to type in a bash session:

source /c/Users/Me/git-subrepo/.rc' >> ~/.bashrc

The OP wiyosaya did (in the comments):

  • create the .bashrc: touch ~/.bashrc
  • add the missing line: echo source /c/GitHub/git-subrepo/.rc >> ~/.bashrc
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks. I managed to figure out, with the help of your answer, how to get the requisite line into the .bashrc file, and I can type in git subrepo from a bash command prompt - without any options - and it gives me the help output. I seem to be all set. – wiyosaya Apr 18 '22 at 13:48
  • @wiyosaya Great, well done! What line did you need? – VonC Apr 18 '22 at 13:48
  • First off, the .bashrc file was not there. So, in a bash command prompt, I typed "source /c/GitHub/git-subrepo/.rc' >> ~/.bashrc" For whatever reason, the line was not added to the .bashrc file, but it did create an empty .bashrc file. I then found that file, and added the line "source /c/GitHub/git-subrepo/.rc" to the file, and that was all I needed. Thanks again! – wiyosaya Apr 18 '22 at 14:12
  • @wiyosaya OK, thank you for the feedback. I have included your comment in the answer for more visibility, as well as the relevant commands. – VonC Apr 18 '22 at 14:31
  • sounds good, however, it might be easier to understand, IMO, if the added line were just source /c/GitHub/git-subrepo/.rc - I knew enough to figure it out, and the "touch" line makes sense. I also have a great windows search program Everything - https://www.voidtools.com/ where the .bashrc file appeared after I tried the command without the echo statement. – wiyosaya Apr 18 '22 at 15:00
  • 1
    @wiyosaya Nice, I didn't know about "everything". No way to use it at work through: it needs admin privileges to index NTFS volumes. – VonC Apr 18 '22 at 17:03