git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* git ability
@ 2021-02-13 13:25 PANEL Christian
  2021-02-13 17:25 ` brian m. carlson
  0 siblings, 1 reply; 2+ messages in thread
From: PANEL Christian @ 2021-02-13 13:25 UTC (permalink / raw)
  To: git

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: git ability
  2021-02-13 13:25 git ability PANEL Christian
@ 2021-02-13 17:25 ` brian m. carlson
  0 siblings, 0 replies; 2+ messages in thread
From: brian m. carlson @ 2021-02-13 17:25 UTC (permalink / raw)
  To: PANEL Christian; +Cc: git

[-- Attachment #1: Type: text/plain, Size: 2633 bytes --]

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.

> 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.

> 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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-13 17:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-13 13:25 git ability PANEL Christian
2021-02-13 17:25 ` brian m. carlson

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).