Posts

Showing posts with the label git

git: listing directories to include

In its normal behaviour, git is for a whole directory, apart from exclusions via .gitignore, and any special git files. What if we want to whitelist what to include?  There isn't a .gitfoo file for this.  But it can probably be achieved via a double negative for files, and a double negative twice for directories: .gitignore: * !included_file !included_dir/ !included_dir/* This is especially useful for picking out parts of a home directory to replicate.

a git curiosity: pushing to a home directory requires dot in path to make it work

I'm making a small service, and the service includes a git repository accessible over ssh, and I don't really want the service interface / address of the repository to include a path.  serviceuser@servicednsname: would be fine. I tried creating a bare git repository in the user's home directory (I assume, but have not tested, that the results are the same whether it's a bare repository or a .git repository).  The result is the following error: $ git push $servicednsname: fatal: '' does not appear to be a git repository fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. So it (is it called git-receive-packs or something? I can't remember) doesn't like an empty path.  But if I put a dot, to signify the current working directory, then it works: $ git push $servicednsname:. Enumerating objects: 3, done. Counting objects: 100% (3/3), done. Delta compression using up to 8 threads Compres...