I had a few Javascript projects and I need to copy or move to another machine. And I would like to ignore files which are already in .gitignore
. Now, when I copy the folder I got git ignored folders and files. But, I want to ignore those when I copy (Command + C). How can I configure it?
You can use git clone:
$ git clone machine1:/path/to/project machine2:/target/path
To remove ignored files from a repository, you can use git clean
.
git clean -nx
-n
means dry-run; it will cause it to list the files it would delete without actually deleting them.-x
means remove ignored files.If you also need to remove directories, specify -d
.
After making sure that what above command prints is what you want to remove, replace -n
with -f
to run it for real.
git clean -fx
Keep in mind that this will delete files, and there is no way of getting them back unless you have a backup.
More info at man git-clean.
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