How do I upload an entire Visual Studio projec开发者_开发百科t(200 files) into GIT? I don't want to have to do one file at a time.
Thanks
Right click in Windows Explorer -> Git create repository here
Right click in Windows Explorer -> Git commit
Enter commit message
Check all files (there is a button for this)
Click OK to commit
Click Push
Click Manage remote
Add a remote: give a name and URL
Click OK to back to Push Dialog
Click OK to push
What I do is, I start a repository in the working dir that I wanted to ad (Git -> Init from the context menu).
I go to 'Git -> Diff' (make sure 'Show unversioned files' and 'Show whole tree' are ticked).
I select all the files to be added at once (multiselect using ctrl-click or shift-click for contiguous region)). Right-click to add. The files are now displayed in the top part of the screen.
I usually take the effort to ignore or delete the remaining files. When you choose to ignore a file, you get the option to ignore the specific path or all files with the same extension. Click refresh button to see the effect of new ignores.
Hint
Sometimes it is more practical to do some ignores up front in order to trim the list of unversioned files shown (make sure that 'Show ignored files' is _un_ticked). For Visual Studio projects,
*.pdb
,bin/
,obj/
, 'Debug/' etc. come to mind.
Finally, click the commit button, and you're done (enter message and click ok).
Alternative:
If you have many projects like this to add, you'd drop into a shell (like git-bash):
cat >> .gitignore <<HERE
*.user
*.suo
_Resharper*
Debug
Release
*scc
# be creative
HERE
git init .
git add .
git commit -am 'initial import'
Done
精彩评论