GIT - connecting existing code to a separate Repository in the same Local machine
up vote
0
down vote
favorite
Say I have my existing VS2015 code in C:Proj1, and I have created a repository in C:RepoProj1.
Now I want to connect my project at C:Proj1 to the Repository at C:RepoProj1.
The problem is when I click on the Publish button in the lower right end of VS2015 window, of VS2015 project (loaded from C:Proj1), it creates the GIT Repository locally inside my project directory (the hidden .git directory, attributes and ignore files). Instead of connecting to the local .git repository, I would like to connect to the repository at C:RepoProj1, everytime I open/use my VS2015 project in C:Proj1
I am using VS2015 (SP3) on Win10.
How to do it? Thanks in advance...
git visual-studio-2015
add a comment |
up vote
0
down vote
favorite
Say I have my existing VS2015 code in C:Proj1, and I have created a repository in C:RepoProj1.
Now I want to connect my project at C:Proj1 to the Repository at C:RepoProj1.
The problem is when I click on the Publish button in the lower right end of VS2015 window, of VS2015 project (loaded from C:Proj1), it creates the GIT Repository locally inside my project directory (the hidden .git directory, attributes and ignore files). Instead of connecting to the local .git repository, I would like to connect to the repository at C:RepoProj1, everytime I open/use my VS2015 project in C:Proj1
I am using VS2015 (SP3) on Win10.
How to do it? Thanks in advance...
git visual-studio-2015
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Say I have my existing VS2015 code in C:Proj1, and I have created a repository in C:RepoProj1.
Now I want to connect my project at C:Proj1 to the Repository at C:RepoProj1.
The problem is when I click on the Publish button in the lower right end of VS2015 window, of VS2015 project (loaded from C:Proj1), it creates the GIT Repository locally inside my project directory (the hidden .git directory, attributes and ignore files). Instead of connecting to the local .git repository, I would like to connect to the repository at C:RepoProj1, everytime I open/use my VS2015 project in C:Proj1
I am using VS2015 (SP3) on Win10.
How to do it? Thanks in advance...
git visual-studio-2015
Say I have my existing VS2015 code in C:Proj1, and I have created a repository in C:RepoProj1.
Now I want to connect my project at C:Proj1 to the Repository at C:RepoProj1.
The problem is when I click on the Publish button in the lower right end of VS2015 window, of VS2015 project (loaded from C:Proj1), it creates the GIT Repository locally inside my project directory (the hidden .git directory, attributes and ignore files). Instead of connecting to the local .git repository, I would like to connect to the repository at C:RepoProj1, everytime I open/use my VS2015 project in C:Proj1
I am using VS2015 (SP3) on Win10.
How to do it? Thanks in advance...
git visual-studio-2015
git visual-studio-2015
asked Nov 9 at 12:51
XMarshall
4413518
4413518
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
up vote
0
down vote
I'm not exactly sure what you mean by
Now I want to connect my project
I believe you're going to want to move/copy your source code into the repo directory (with the .git folder).
And then work out of the repo directory.
You can start a new repo with git clone
or git init
and then you will want to work out of that directory so the .git folder can track everything.
1
Thanks to everybody for their Answers. My idea was to keep the Repository in a separate directory, other than my actual project directory. Because, what if I delete my actual project directory my mistake, I can then have my files back from the repository again. Off course since .git directory is hidden, it will not be deleted or I will be asked if I want to delete it. Basically, I was trying to implement the same concept of URL based remote Repository, but in my case, it will be in my same local machine, but in a different location. Probably I am not thinking in the right direction...
– XMarshall
Nov 9 at 14:44
add a comment |
up vote
0
down vote
You can make your project at C:Proj1
a submodule of C:RepoProj1
Just go to C:RepoProj1
and execute in bash:
git submodule add C:/Proj1
Then go to C:Proj1
:
git submodule init
git submodule update
Find more here: https://stackoverflow.com/a/36554930
add a comment |
up vote
0
down vote
It sounds to me as if you have created the repository in the wrong place.. perhaps you could symlink the folders inside.
You can do this using an elevated command prompt;
mklink /d "C:RepoProj1" "C:Proj1"
/d - create a directory link
(https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/mklink)
Quote's aren't required if you don't have spaces in the directory names - but imo are recommended for good practice.
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
I'm not exactly sure what you mean by
Now I want to connect my project
I believe you're going to want to move/copy your source code into the repo directory (with the .git folder).
And then work out of the repo directory.
You can start a new repo with git clone
or git init
and then you will want to work out of that directory so the .git folder can track everything.
1
Thanks to everybody for their Answers. My idea was to keep the Repository in a separate directory, other than my actual project directory. Because, what if I delete my actual project directory my mistake, I can then have my files back from the repository again. Off course since .git directory is hidden, it will not be deleted or I will be asked if I want to delete it. Basically, I was trying to implement the same concept of URL based remote Repository, but in my case, it will be in my same local machine, but in a different location. Probably I am not thinking in the right direction...
– XMarshall
Nov 9 at 14:44
add a comment |
up vote
0
down vote
I'm not exactly sure what you mean by
Now I want to connect my project
I believe you're going to want to move/copy your source code into the repo directory (with the .git folder).
And then work out of the repo directory.
You can start a new repo with git clone
or git init
and then you will want to work out of that directory so the .git folder can track everything.
1
Thanks to everybody for their Answers. My idea was to keep the Repository in a separate directory, other than my actual project directory. Because, what if I delete my actual project directory my mistake, I can then have my files back from the repository again. Off course since .git directory is hidden, it will not be deleted or I will be asked if I want to delete it. Basically, I was trying to implement the same concept of URL based remote Repository, but in my case, it will be in my same local machine, but in a different location. Probably I am not thinking in the right direction...
– XMarshall
Nov 9 at 14:44
add a comment |
up vote
0
down vote
up vote
0
down vote
I'm not exactly sure what you mean by
Now I want to connect my project
I believe you're going to want to move/copy your source code into the repo directory (with the .git folder).
And then work out of the repo directory.
You can start a new repo with git clone
or git init
and then you will want to work out of that directory so the .git folder can track everything.
I'm not exactly sure what you mean by
Now I want to connect my project
I believe you're going to want to move/copy your source code into the repo directory (with the .git folder).
And then work out of the repo directory.
You can start a new repo with git clone
or git init
and then you will want to work out of that directory so the .git folder can track everything.
answered Nov 9 at 12:59
JBoothUA
819424
819424
1
Thanks to everybody for their Answers. My idea was to keep the Repository in a separate directory, other than my actual project directory. Because, what if I delete my actual project directory my mistake, I can then have my files back from the repository again. Off course since .git directory is hidden, it will not be deleted or I will be asked if I want to delete it. Basically, I was trying to implement the same concept of URL based remote Repository, but in my case, it will be in my same local machine, but in a different location. Probably I am not thinking in the right direction...
– XMarshall
Nov 9 at 14:44
add a comment |
1
Thanks to everybody for their Answers. My idea was to keep the Repository in a separate directory, other than my actual project directory. Because, what if I delete my actual project directory my mistake, I can then have my files back from the repository again. Off course since .git directory is hidden, it will not be deleted or I will be asked if I want to delete it. Basically, I was trying to implement the same concept of URL based remote Repository, but in my case, it will be in my same local machine, but in a different location. Probably I am not thinking in the right direction...
– XMarshall
Nov 9 at 14:44
1
1
Thanks to everybody for their Answers. My idea was to keep the Repository in a separate directory, other than my actual project directory. Because, what if I delete my actual project directory my mistake, I can then have my files back from the repository again. Off course since .git directory is hidden, it will not be deleted or I will be asked if I want to delete it. Basically, I was trying to implement the same concept of URL based remote Repository, but in my case, it will be in my same local machine, but in a different location. Probably I am not thinking in the right direction...
– XMarshall
Nov 9 at 14:44
Thanks to everybody for their Answers. My idea was to keep the Repository in a separate directory, other than my actual project directory. Because, what if I delete my actual project directory my mistake, I can then have my files back from the repository again. Off course since .git directory is hidden, it will not be deleted or I will be asked if I want to delete it. Basically, I was trying to implement the same concept of URL based remote Repository, but in my case, it will be in my same local machine, but in a different location. Probably I am not thinking in the right direction...
– XMarshall
Nov 9 at 14:44
add a comment |
up vote
0
down vote
You can make your project at C:Proj1
a submodule of C:RepoProj1
Just go to C:RepoProj1
and execute in bash:
git submodule add C:/Proj1
Then go to C:Proj1
:
git submodule init
git submodule update
Find more here: https://stackoverflow.com/a/36554930
add a comment |
up vote
0
down vote
You can make your project at C:Proj1
a submodule of C:RepoProj1
Just go to C:RepoProj1
and execute in bash:
git submodule add C:/Proj1
Then go to C:Proj1
:
git submodule init
git submodule update
Find more here: https://stackoverflow.com/a/36554930
add a comment |
up vote
0
down vote
up vote
0
down vote
You can make your project at C:Proj1
a submodule of C:RepoProj1
Just go to C:RepoProj1
and execute in bash:
git submodule add C:/Proj1
Then go to C:Proj1
:
git submodule init
git submodule update
Find more here: https://stackoverflow.com/a/36554930
You can make your project at C:Proj1
a submodule of C:RepoProj1
Just go to C:RepoProj1
and execute in bash:
git submodule add C:/Proj1
Then go to C:Proj1
:
git submodule init
git submodule update
Find more here: https://stackoverflow.com/a/36554930
answered Nov 9 at 13:03
mibrl12
191115
191115
add a comment |
add a comment |
up vote
0
down vote
It sounds to me as if you have created the repository in the wrong place.. perhaps you could symlink the folders inside.
You can do this using an elevated command prompt;
mklink /d "C:RepoProj1" "C:Proj1"
/d - create a directory link
(https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/mklink)
Quote's aren't required if you don't have spaces in the directory names - but imo are recommended for good practice.
add a comment |
up vote
0
down vote
It sounds to me as if you have created the repository in the wrong place.. perhaps you could symlink the folders inside.
You can do this using an elevated command prompt;
mklink /d "C:RepoProj1" "C:Proj1"
/d - create a directory link
(https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/mklink)
Quote's aren't required if you don't have spaces in the directory names - but imo are recommended for good practice.
add a comment |
up vote
0
down vote
up vote
0
down vote
It sounds to me as if you have created the repository in the wrong place.. perhaps you could symlink the folders inside.
You can do this using an elevated command prompt;
mklink /d "C:RepoProj1" "C:Proj1"
/d - create a directory link
(https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/mklink)
Quote's aren't required if you don't have spaces in the directory names - but imo are recommended for good practice.
It sounds to me as if you have created the repository in the wrong place.. perhaps you could symlink the folders inside.
You can do this using an elevated command prompt;
mklink /d "C:RepoProj1" "C:Proj1"
/d - create a directory link
(https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/mklink)
Quote's aren't required if you don't have spaces in the directory names - but imo are recommended for good practice.
answered Nov 9 at 13:04
essdeeeff
63
63
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53226047%2fgit-connecting-existing-code-to-a-separate-repository-in-the-same-local-machin%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown