Is there a simple way to create a copy of a folder in a local repository, keeping track of exactly the same files (do not care about commit history, or untracked files)?
The folder contains a hierarchy of both tracked and untracked (but not ignored) files and directories. I basically want to recursively replicate the tracked structure. Is there a way other than copying everything, and then manually adding only the relevant files (there are a lot of them)?
If you don't care about the history, you could just copy the directory and then git add
it:
$ cp -R old_dir new_dir
$ git add new_dir
$ git commit -m "first revision of new_dir's copied files"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With