Path: csiph.com!weretis.net!feeder9.news.weretis.net!panix!.POSTED.2602:f977:0:1::3!not-for-mail From: pa@see.signature.invalid (Pierre Asselin) Newsgroups: comp.os.linux.misc Subject: Re: basic git operations Date: Sat, 22 Nov 2025 19:52:23 -0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Message-ID: <10ft49n$ii0$1@reader2.panix.com> References: Injection-Date: Sat, 22 Nov 2025 19:52:23 -0000 (UTC) Injection-Info: reader2.panix.com; posting-host="2602:f977:0:1::3"; logging-data="19008"; mail-complaints-to="abuse@panix.com" User-Agent: tin/2.6.4-20241224 ("Helmsdale") (NetBSD/10.1 (amd64)) Xref: csiph.com comp.os.linux.misc:77816 Stefan Ram wrote: > I copied my project files and directories to a directory D. > Then, in D (i.e., after "cd D"), I said, > git init . > git add . > and got "fatal: This operation must be run in a work tree". > What is a work tree?? (Don't answer this! By now I know.) With a dot after "git init" ? On Linux, "man git init" contains the following snippet: ====================================================================== EXAMPLES Start a new Git repository for an existing code base $ cd /path/to/my/codebase $ git init (1) $ git add . (2) $ git commit (3) 1. Create a /path/to/my/codebase/.git directory. 2. Add all existing files to the index. 3. Record the pristine state as the first commit in the history. ====================================================================== A duckduckgo search on "git tutorial" returns tons of links, among them https://git-scm.com/docs/gittutorial git is a beast, but for your own projects you can keep the workflow simple. (I prefer mercurial myself... https://www.mercurial-scm.org/ )