Your cart is currently empty!
How to add a remote folder share as a remote git repository in vs code?
In some cases, you might just wanna push your code to a network folder and use that as your remote. This will also work without vscode as long as you can get to the command line and you have the necessary folder permissions. Here is how ๐
First you will need to initialise your remote repository. You can open git bash or a vscode terminal and use the following:
git init --bare
The bare tag is important! I means nothing is in there, so its able to be pushed to!
Next we need to go to our local working folder, and if we havent initialised a git repo there we can use:
git init
Now to add our remote!
git remote add origin "\\\your\share\folder\path\your remote git folder"
Lets decode this
- Notice the extra \ at the start? that is needed as the “\ seems to be combined as ” your results may vary and you may only need two
- All the slashes are BACK slashes ๐
- Put a ” on the end to close the quotes
- Notice the “origin”? That is like the friendly name for the remote. Origin seems to be the default in most cases
Next, you will probably want to push, so you can make some changes in your folder, then
- git add .
- git commit -m “your commit message”
- git push origin
And there you should have it! Hope this helped!
by
Leave a Reply