Include files in Git but not in Github
Answered
I have a Django project in PyCharm Professional, which I imported into version control Git. I have imported the project as a whole.
Now I want to create a Github repository but there are files and folders that I want to be on Git locally but not on the Github repository.
I can share my project on Github through the VCS menu, but it will include everything.
Is there a way to have files and folders in Git but not in Github ? Maybe add them later ?
Please sign in to leave a comment.
GitHub is a remote Git repository, so if the files are registered locally in Git, then they will be pushed to the remote Git repository (GitHub.)
You can use .gitignore of course to omit certain files from going into Git.
So, I can't push individual files or folder that are in Git to Github. Is this a Git limitation or a PyCharm one ?
This is all about Git repositories, not PyCharm. It's possible there is some advanced feature in Git that I'm not aware of which allows a file to be in a *local* repository but not in a remote. But that would very much be against Git's concept of how repositories and commits work.
Yes, Git can commit certain changes without committing other changes.