git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git ability

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Feb 13, 2021, 17:25 UTC
Message-ID
<YCgLmgrKCV9AIzMI@camp.crustytoothpaste.net>
In-Reply-To
<24e39c2c4b7b86aa4a671601a069eaee767a63fb.camel@free.fr>
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
Previous: PANEL Christian
Message 2 of 2 in “git ability”
  1. PANEL ChristianFeb 13, 2021
  2. brian m. carlsonFeb 13, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.