I am currently programming a project in C for the TI84CE. I want to be able to use Git to store a version history. I have used the git command line interface before on a personal computer. However, I want to be able to use git on my school laptop (the computer I have the most access to). Since I do not have the admin privileges to just set up the standard git command line, I went over to here to download the portable version (32-bit).

I extracted the download to the root directory of my flashdrive (D:). I ran git-bash.exe and soon realized I didn't have access to the rest of the flashdrive outside of the portablegit folder. The directory of Portable Git was D:/portablegit and the directory of the program I wanted to create the git repository was D:/C/Minecraft/Minecraft. One obvious solution was just to put my project inside the portablegit folder but I think there is a more convenient way by modifying the %path% variable (I'm still not entirely sure what that means).

I read through readme provided in portablegit/readme.portable and found this:


I opened up git-bash-exe and typed in:

Code:
set HOME=%cd%/home

which didn't return anything.

Then I typed in the second line and got this:

Code:
$ git --cd-to-home
unknown option: --cd-to-home
usage: git [--version] [--help] [-C <path>] [-c <name>=<value>]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]


If I understood the readme correctly, I can set the HOME directory outside of the portablegit folder (e.g. D:/), which will allow me to navigate to my C project and setup a git repository inside of it. However, directly typing

Code:
set HOME=%cd%/home
git --cd-to-home

into git-bash.exe resulted in an error.

So my question is, is there a way to setup a git repository in my C project folder without physically moving inside of portablegit? And am I on the right track by trying to set up the HOME environment variable following the readme provided? And if so, what am I doing wrong?

Thanks in advance.

Edit:

Inside of git-bash.exe, I tried just navigating out of the portablegit directory by using cd .., but it still remained in the same directory.
KaluW_ wrote:
One obvious solution was just to put my project inside the portablegit folder but I think there is a more convenient way by modifying the %path% variable (I'm still not entirely sure what that means).

The PATH variable tells the OS where to look for programs when you run things from the command line. Since you don't have admin privileges, you won't be able to change this variable. It works from that particular folder because that is the folder where the git programs live. Once you navigate outside of this folder, the OS has no idea where to find the git program.

Alternatively, you can run a script that changes the path variable temporarily. Note that once you close the terminal, the path will revert and no longer work.


Code:
       set gitdir=d:\portablegit
        set path=%gitdir%\cmd;%path%
MateoConLechuga wrote:

Alternatively, you can run a script that changes the path variable temporarily. Note that once you close the terminal, the path will revert and no longer work.


Code:
set gitdir=d:\portablegit
set path=%gitdir%\cmd;%path%



I initially tried doing this in git bash a couple of months ago and it's just now that I realized you were referring to the Windows terminal (literally what else would you have been referring to? *facepalms*)

Anyways, I created a cmd script containing the above code and now everything works. Thanks! Very Happy
lol
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement