I have a local directory whose structure is something like :
- dir1
- dir1.1
- dir1.2
- dir1.3
- file1.3.1
- file1.3.2
- file1.3.3
- dir2
- dir2.1
- dir2.2
- dir2.3
Structure of my github repository is :
- dir1
- dir1.1
- dir1.2
- dir1.3
- file1.3.1
- file1.3.2
- dir2
- dir2.1
- dir2.2
- dir2.3
- file2.3.1
- file2.3.2
- dir3
- dir3.1
- dir3.2
- dir3.3
As it can be noticed, the github repository has some extra directories as well as some extra files in some directories. It may have some files missing as compared to local directory. So, I am looking for a way to push the changes of only those files which are already present in the repository. In other words, I want all other files/folders to be ignored. I don't want to add those new files/folders when I push. I only want the existing files to be synced.
I got this link which gives only suggests a way to ignore a folder. git to ignore a hidden directory in the local repo This doesn't solve my problem.
Please suggest how can I solve this problem. Thanks.