Using git with synced files with different Windows usernames
up vote
1
down vote
favorite
For a particular git repository, I'm using a OneDrive account to keep two Windows 10 machines synced, let's say MachineA
and MachineB
. Yes I could do the push/pull/merge dance between the two machines, so please don't recommend that. I'm asking about a specific off-label usage of git. I do this because I switch very often when coding at home (back and forth between desk and sofa, depending on kid, wife, dinnertime), and because I don't want to commit half-written code or pollute my history with a zillion trivial commits.
Beyond Compare tells me the files are binary-same, but although I can edit the files and execute my project, I cannot run any git commands on the machine opposite from where the repo was created. Somehow the username is captured in the repository.
For instance, if I had created the repo on MachineA with usernameA, then run any git command on MachineB (having usernameB), I get:
$ git status
fatal: Invalid path 'c:/Users/usernameA': No such file or directory
This failure happens in both directions, depending on where the git repo was created. Git works fine elsewhere on each machine independently, but does not work on the other machine. I'm using using git 2.18.0.windows.1 on one machine and and 2.17.1.windows2 on the other.
I could not find a hard-coded username or user home directory in any human-readable config setting -- global, system, or local to the repo.
I can replicate the problem with a fresh repository, with no files or commits -- just a git init
.
If this is a fundamentally not workable usage of git, then I'll change my habits.
If, technically speaking, a binary-same git directory should work on a machine different from where it was created, I'd like to know how to fix this.
git
add a comment |
up vote
1
down vote
favorite
For a particular git repository, I'm using a OneDrive account to keep two Windows 10 machines synced, let's say MachineA
and MachineB
. Yes I could do the push/pull/merge dance between the two machines, so please don't recommend that. I'm asking about a specific off-label usage of git. I do this because I switch very often when coding at home (back and forth between desk and sofa, depending on kid, wife, dinnertime), and because I don't want to commit half-written code or pollute my history with a zillion trivial commits.
Beyond Compare tells me the files are binary-same, but although I can edit the files and execute my project, I cannot run any git commands on the machine opposite from where the repo was created. Somehow the username is captured in the repository.
For instance, if I had created the repo on MachineA with usernameA, then run any git command on MachineB (having usernameB), I get:
$ git status
fatal: Invalid path 'c:/Users/usernameA': No such file or directory
This failure happens in both directions, depending on where the git repo was created. Git works fine elsewhere on each machine independently, but does not work on the other machine. I'm using using git 2.18.0.windows.1 on one machine and and 2.17.1.windows2 on the other.
I could not find a hard-coded username or user home directory in any human-readable config setting -- global, system, or local to the repo.
I can replicate the problem with a fresh repository, with no files or commits -- just a git init
.
If this is a fundamentally not workable usage of git, then I'll change my habits.
If, technically speaking, a binary-same git directory should work on a machine different from where it was created, I'd like to know how to fix this.
git
Are u using the same paths on both machines? One Drive store an internal settings as well
– CodeWizard
Nov 10 at 22:30
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
For a particular git repository, I'm using a OneDrive account to keep two Windows 10 machines synced, let's say MachineA
and MachineB
. Yes I could do the push/pull/merge dance between the two machines, so please don't recommend that. I'm asking about a specific off-label usage of git. I do this because I switch very often when coding at home (back and forth between desk and sofa, depending on kid, wife, dinnertime), and because I don't want to commit half-written code or pollute my history with a zillion trivial commits.
Beyond Compare tells me the files are binary-same, but although I can edit the files and execute my project, I cannot run any git commands on the machine opposite from where the repo was created. Somehow the username is captured in the repository.
For instance, if I had created the repo on MachineA with usernameA, then run any git command on MachineB (having usernameB), I get:
$ git status
fatal: Invalid path 'c:/Users/usernameA': No such file or directory
This failure happens in both directions, depending on where the git repo was created. Git works fine elsewhere on each machine independently, but does not work on the other machine. I'm using using git 2.18.0.windows.1 on one machine and and 2.17.1.windows2 on the other.
I could not find a hard-coded username or user home directory in any human-readable config setting -- global, system, or local to the repo.
I can replicate the problem with a fresh repository, with no files or commits -- just a git init
.
If this is a fundamentally not workable usage of git, then I'll change my habits.
If, technically speaking, a binary-same git directory should work on a machine different from where it was created, I'd like to know how to fix this.
git
For a particular git repository, I'm using a OneDrive account to keep two Windows 10 machines synced, let's say MachineA
and MachineB
. Yes I could do the push/pull/merge dance between the two machines, so please don't recommend that. I'm asking about a specific off-label usage of git. I do this because I switch very often when coding at home (back and forth between desk and sofa, depending on kid, wife, dinnertime), and because I don't want to commit half-written code or pollute my history with a zillion trivial commits.
Beyond Compare tells me the files are binary-same, but although I can edit the files and execute my project, I cannot run any git commands on the machine opposite from where the repo was created. Somehow the username is captured in the repository.
For instance, if I had created the repo on MachineA with usernameA, then run any git command on MachineB (having usernameB), I get:
$ git status
fatal: Invalid path 'c:/Users/usernameA': No such file or directory
This failure happens in both directions, depending on where the git repo was created. Git works fine elsewhere on each machine independently, but does not work on the other machine. I'm using using git 2.18.0.windows.1 on one machine and and 2.17.1.windows2 on the other.
I could not find a hard-coded username or user home directory in any human-readable config setting -- global, system, or local to the repo.
I can replicate the problem with a fresh repository, with no files or commits -- just a git init
.
If this is a fundamentally not workable usage of git, then I'll change my habits.
If, technically speaking, a binary-same git directory should work on a machine different from where it was created, I'd like to know how to fix this.
git
git
asked Nov 10 at 22:13
Sonicsmooth
1,30121225
1,30121225
Are u using the same paths on both machines? One Drive store an internal settings as well
– CodeWizard
Nov 10 at 22:30
add a comment |
Are u using the same paths on both machines? One Drive store an internal settings as well
– CodeWizard
Nov 10 at 22:30
Are u using the same paths on both machines? One Drive store an internal settings as well
– CodeWizard
Nov 10 at 22:30
Are u using the same paths on both machines? One Drive store an internal settings as well
– CodeWizard
Nov 10 at 22:30
add a comment |
2 Answers
2
active
oldest
votes
up vote
0
down vote
accepted
and because I don't want to commit half-written code or pollute my history with a zillion trivial commits.
You can always commit a "WIP" (Work-In-Progress) on a dedicated draft branch, where you git push --force
every time you need to store said work-in-progress.
Regarding the error message, check all the settings with git config -l --show-origin
.
Make sure to upgrade first to 2.19.1 and see if the issue persists. (PR 1645 was somehow related to this error)
On machineA, it tells me that .gitconfig is stored in c:/users/usernameA... so this is finally a clue.
– Sonicsmooth
Nov 11 at 11:02
I added a folder with the same username and copied the .gitconfig. Kinda kludgey, but it moved the error elsehwere. Now.git/config
shows the local drive name in theworktree option
under[core]
. I won't try to mess with that.
– Sonicsmooth
Nov 11 at 11:28
add a comment |
up vote
0
down vote
You store your code under c:usersusername. Move it outside this path (you can use mklink /j to link it to c:usersusername to get it synced). Git uses absolute paths sometime and those abs paths are different on machineA and machineB.
So strictly speaking, the code on the left is inc:usersusernameAonedrivecompanynamedevclojureprojectname
with a symlink toc:dev
. On the right it's the same with usernameB and a symlink toc:kdev
. I work exclusively in thec:dev
andc:kdev
linked directories, but the error still refers to the user's home directory where Onedrive likes to live. I'll dig around some more to see if I can find how git may encode originating repository's username.
– Sonicsmooth
Nov 11 at 10:56
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
and because I don't want to commit half-written code or pollute my history with a zillion trivial commits.
You can always commit a "WIP" (Work-In-Progress) on a dedicated draft branch, where you git push --force
every time you need to store said work-in-progress.
Regarding the error message, check all the settings with git config -l --show-origin
.
Make sure to upgrade first to 2.19.1 and see if the issue persists. (PR 1645 was somehow related to this error)
On machineA, it tells me that .gitconfig is stored in c:/users/usernameA... so this is finally a clue.
– Sonicsmooth
Nov 11 at 11:02
I added a folder with the same username and copied the .gitconfig. Kinda kludgey, but it moved the error elsehwere. Now.git/config
shows the local drive name in theworktree option
under[core]
. I won't try to mess with that.
– Sonicsmooth
Nov 11 at 11:28
add a comment |
up vote
0
down vote
accepted
and because I don't want to commit half-written code or pollute my history with a zillion trivial commits.
You can always commit a "WIP" (Work-In-Progress) on a dedicated draft branch, where you git push --force
every time you need to store said work-in-progress.
Regarding the error message, check all the settings with git config -l --show-origin
.
Make sure to upgrade first to 2.19.1 and see if the issue persists. (PR 1645 was somehow related to this error)
On machineA, it tells me that .gitconfig is stored in c:/users/usernameA... so this is finally a clue.
– Sonicsmooth
Nov 11 at 11:02
I added a folder with the same username and copied the .gitconfig. Kinda kludgey, but it moved the error elsehwere. Now.git/config
shows the local drive name in theworktree option
under[core]
. I won't try to mess with that.
– Sonicsmooth
Nov 11 at 11:28
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
and because I don't want to commit half-written code or pollute my history with a zillion trivial commits.
You can always commit a "WIP" (Work-In-Progress) on a dedicated draft branch, where you git push --force
every time you need to store said work-in-progress.
Regarding the error message, check all the settings with git config -l --show-origin
.
Make sure to upgrade first to 2.19.1 and see if the issue persists. (PR 1645 was somehow related to this error)
and because I don't want to commit half-written code or pollute my history with a zillion trivial commits.
You can always commit a "WIP" (Work-In-Progress) on a dedicated draft branch, where you git push --force
every time you need to store said work-in-progress.
Regarding the error message, check all the settings with git config -l --show-origin
.
Make sure to upgrade first to 2.19.1 and see if the issue persists. (PR 1645 was somehow related to this error)
answered Nov 11 at 0:53
VonC
821k28425803095
821k28425803095
On machineA, it tells me that .gitconfig is stored in c:/users/usernameA... so this is finally a clue.
– Sonicsmooth
Nov 11 at 11:02
I added a folder with the same username and copied the .gitconfig. Kinda kludgey, but it moved the error elsehwere. Now.git/config
shows the local drive name in theworktree option
under[core]
. I won't try to mess with that.
– Sonicsmooth
Nov 11 at 11:28
add a comment |
On machineA, it tells me that .gitconfig is stored in c:/users/usernameA... so this is finally a clue.
– Sonicsmooth
Nov 11 at 11:02
I added a folder with the same username and copied the .gitconfig. Kinda kludgey, but it moved the error elsehwere. Now.git/config
shows the local drive name in theworktree option
under[core]
. I won't try to mess with that.
– Sonicsmooth
Nov 11 at 11:28
On machineA, it tells me that .gitconfig is stored in c:/users/usernameA... so this is finally a clue.
– Sonicsmooth
Nov 11 at 11:02
On machineA, it tells me that .gitconfig is stored in c:/users/usernameA... so this is finally a clue.
– Sonicsmooth
Nov 11 at 11:02
I added a folder with the same username and copied the .gitconfig. Kinda kludgey, but it moved the error elsehwere. Now
.git/config
shows the local drive name in the worktree option
under [core]
. I won't try to mess with that.– Sonicsmooth
Nov 11 at 11:28
I added a folder with the same username and copied the .gitconfig. Kinda kludgey, but it moved the error elsehwere. Now
.git/config
shows the local drive name in the worktree option
under [core]
. I won't try to mess with that.– Sonicsmooth
Nov 11 at 11:28
add a comment |
up vote
0
down vote
You store your code under c:usersusername. Move it outside this path (you can use mklink /j to link it to c:usersusername to get it synced). Git uses absolute paths sometime and those abs paths are different on machineA and machineB.
So strictly speaking, the code on the left is inc:usersusernameAonedrivecompanynamedevclojureprojectname
with a symlink toc:dev
. On the right it's the same with usernameB and a symlink toc:kdev
. I work exclusively in thec:dev
andc:kdev
linked directories, but the error still refers to the user's home directory where Onedrive likes to live. I'll dig around some more to see if I can find how git may encode originating repository's username.
– Sonicsmooth
Nov 11 at 10:56
add a comment |
up vote
0
down vote
You store your code under c:usersusername. Move it outside this path (you can use mklink /j to link it to c:usersusername to get it synced). Git uses absolute paths sometime and those abs paths are different on machineA and machineB.
So strictly speaking, the code on the left is inc:usersusernameAonedrivecompanynamedevclojureprojectname
with a symlink toc:dev
. On the right it's the same with usernameB and a symlink toc:kdev
. I work exclusively in thec:dev
andc:kdev
linked directories, but the error still refers to the user's home directory where Onedrive likes to live. I'll dig around some more to see if I can find how git may encode originating repository's username.
– Sonicsmooth
Nov 11 at 10:56
add a comment |
up vote
0
down vote
up vote
0
down vote
You store your code under c:usersusername. Move it outside this path (you can use mklink /j to link it to c:usersusername to get it synced). Git uses absolute paths sometime and those abs paths are different on machineA and machineB.
You store your code under c:usersusername. Move it outside this path (you can use mklink /j to link it to c:usersusername to get it synced). Git uses absolute paths sometime and those abs paths are different on machineA and machineB.
answered Nov 11 at 1:10
Martin Urbanec
2818
2818
So strictly speaking, the code on the left is inc:usersusernameAonedrivecompanynamedevclojureprojectname
with a symlink toc:dev
. On the right it's the same with usernameB and a symlink toc:kdev
. I work exclusively in thec:dev
andc:kdev
linked directories, but the error still refers to the user's home directory where Onedrive likes to live. I'll dig around some more to see if I can find how git may encode originating repository's username.
– Sonicsmooth
Nov 11 at 10:56
add a comment |
So strictly speaking, the code on the left is inc:usersusernameAonedrivecompanynamedevclojureprojectname
with a symlink toc:dev
. On the right it's the same with usernameB and a symlink toc:kdev
. I work exclusively in thec:dev
andc:kdev
linked directories, but the error still refers to the user's home directory where Onedrive likes to live. I'll dig around some more to see if I can find how git may encode originating repository's username.
– Sonicsmooth
Nov 11 at 10:56
So strictly speaking, the code on the left is in
c:usersusernameAonedrivecompanynamedevclojureprojectname
with a symlink to c:dev
. On the right it's the same with usernameB and a symlink to c:kdev
. I work exclusively in the c:dev
and c:kdev
linked directories, but the error still refers to the user's home directory where Onedrive likes to live. I'll dig around some more to see if I can find how git may encode originating repository's username.– Sonicsmooth
Nov 11 at 10:56
So strictly speaking, the code on the left is in
c:usersusernameAonedrivecompanynamedevclojureprojectname
with a symlink to c:dev
. On the right it's the same with usernameB and a symlink to c:kdev
. I work exclusively in the c:dev
and c:kdev
linked directories, but the error still refers to the user's home directory where Onedrive likes to live. I'll dig around some more to see if I can find how git may encode originating repository's username.– Sonicsmooth
Nov 11 at 10:56
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%2f53243946%2fusing-git-with-synced-files-with-different-windows-usernames%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
Are u using the same paths on both machines? One Drive store an internal settings as well
– CodeWizard
Nov 10 at 22:30