The general idea is to add, commit and push your files to the GitHub repo.
First you need to clone your GitHub repo.
Then, you would git add all the files from your other folder: one trick is to specify an alternate working tree when git add'ing your files.
git --work-tree=yourSrcFolder add .
(done from the root directory of your cloned Git repo, then git commit -m "a msg"
, and git push origin master
)
That way, you keep separate your initial source folder, from your Git working tree.
Note that since early December 2012, you can create new files directly from GitHub:
ProTip?: You can pre-fill the filename field using just the URL.
Typing ?filename=yournewfile.txt
at the end of the URL will pre-fill the filename field with the name yournewfile.txt
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…