threads / discuss / 55142

git ability

Subject: git ability

## tl;dr

2 messages between Feb 13, 2021 and Feb 13, 2021.

replies: 1people: 2as markdown or json

PANEL Christian· Feb 13, 2021, 13:25 UTC · lore
hello,
does git have the ability to handle a repository on a removable disk?
here is the experience I had:

I have a project that I manage on a removable disk (therefore with a ".git" directory on it).

until now I did "commits" and "push" on the server from windows10.

I made changes to the source and made a "commit" from linux (on the same computer). Git asked me again for my username (email and user name): I then thought that these were not stored in the ".git" directory

I then saw a new branch called "linuxcompatibility" appear.
I would like to understand.

I thought to myself that I would then merge the "linuxcompatibility" branch to the "master" branch and push it all back to the server.

if that went well with me, on the server the branch "linuxcompatibility" remained.

how to get rid of it: nothing seems indicated in the documentation.
Thanks for any clarification
brian m. carlson· Feb 13, 2021, 17:25 UTC · re: PANEL Christian · lore

Re: git ability

On 2021-02-13 at 13:25:03, PANEL Christian wrote:
> hello,
> 
> does git have the ability to handle a repository on a removable disk?

Yes, this is possible. You should access it from only one operating system at a time.

I also strongly recommend that if you're going to do this across operating systems, you use UDF[0] and not NTFS, FAT, or exFAT for this purpose. Linux can format drives this way for use across OSes.

Show 11 quoted lines
> here is the experience I had:
> 
> I have a project that I manage on a removable disk (therefore with a
> ".git" directory on it).
> 
> until now I did "commits" and "push" on the server from windows10.
> 
> I made changes to the source and made a "commit" from linux (on the
> same computer). Git asked me again for my username (email and user
> name): I then thought that these were not stored in the ".git"
> directory

These settings, user.name and user.email, _can_ be stored in .git/config, but _usually_ are stored in the user's home directory, which will differ between operating systems. You can use the "git config" tool to set them appropriately if you'd like. I personally sync my dotfiles across machines, which includes .gitconfig, which is an approach many others use as well.

> I then saw a new branch called "linuxcompatibility" appear.
> 
> I would like to understand.

Git doesn't create branches unless requested. It's possible that some other tool on your system did. For example, if you're using a file syncing service (e.g., Dropbox or OneDrive) to sync data, that's definitely not recommended and can cause problems like this. If you're using WSL instead of a true Linux system, that data could also have been created by Windows.

It's also possible that this branch already existed on the server and it may have shown up as a remote tracking branch with "git branch -a", in which case attempting to check it out may have created a local copy.

Without more details or output from a program, it's hard to say what's going on here.

Show 5 quoted lines
> I thought to myself that I would then merge the "linuxcompatibility"
> branch to the "master" branch and push it all back to the server.
> 
> if that went well with me, on the server the branch
> "linuxcompatibility" remained.
If you want to delete a branch on the remote server, you can do this:
  git push -d origin linuxcompatibility
If you want to delete a branch locally, you can do this:
  git branch -d linuxcompatibility

[0] https://en.wikipedia.org/wiki/Universal_Disk_Format; v2.01 is recommended.

-- 
brian m. carlson (he/him or they/them)
Houston, Texas, US

← back to recent threads