Git add except 1 folder

I do not want to represent the projectname.project folder. Now i use that

git add .
...

...
git push orign master

I do not want to represent the projectname.project folder. When i use

git rm -r projectname.project

git delete the project projectname.project on my computer and I need to create the project again.

+3
source share
3 answers

You can remove from an index in git not on your file system

git rm -r projectname.project --cached

Now this directory is deleted in versonning not on your file system

+11
source

add it to .gitignore (more about github guide )

+7
source

, :

  • , projectname.project , git, git reset projectname.project
  • If you want to completely remove portjectname.project from git tracking, add it to .gitignore (to prevent this from being added in the future), remove it from the cache (if it is already being tracked) with git rm --cached projectname.project
+5
source

Source: https://habr.com/ru/post/1736114/


All Articles