This Git question is very similar to another one about SVN.
I have a repo full of big files and I need to add a single file to it. This used to be very easy in SVN.<
There is no way to do that. I just made a test following:
mkdir hello_independent (note:"hello" is my previous repository's name)git init (note:create a repository with blank here)git remote set-url origin https://github.com/solio/GitPractice.git (note:set the local repository point to the remote repository.)vim newfilefromindependentfolder.md (note:add a new file)git add --agit commit -m "test commit from independent folder."git push origin master (note:this operation is the key)it will show this error:(sorry I can't upload the image of my operation and hint message without 10 reputation)
here is my comprehension of the message:when I do this there are two different independent workflow,they have nothing relationship.So when you want to commit the independent files to the remote repository you must merge the local repository and the remote.So the best way to solve this is git clone the remote repository.