【背景】
折腾:
【记录】把BlogsToWordpress项目从GoogleCode搬家到SourceForge
期间,需要用git把代码上传到SourceForge上去。
【折腾过程】
1.参考sourceForge上面的提示,打开win7中的cygwin,去试试用git。
2.这个是当前的一些文件:
CLi@PC-CLI-1 /cygdrive/d/tmp/tmp_dev_root/git/BlogsToWordpress $ ls BlogsToWordpress.py* materials/ modifiedPostPattern_BaiduNew_serial_story.txt* libs/ modifiedPostPattern_Baidu_serial_story.txt* modifiedPostPattern_Netease_againinput4.txt* CLi@PC-CLI-1 /cygdrive/d/tmp/tmp_dev_root/git/BlogsToWordpress $ ls -lha total 108K drwxrwxrwx+ 1 Administrators Domänen-Benutzer 0 Aug 27 10:33 ./ drwxrwxrwx+ 1 Administrators Domänen-Benutzer 0 Aug 27 10:32 ../ -rwxrwxrwx+ 1 Administrators Domänen-Benutzer 92K Aug 27 09:43 BlogsToWordpress.py* drwxrwxrwx+ 1 Administrators Domänen-Benutzer 0 Aug 27 10:32 libs/ drwxrwxrwx+ 1 Administrators Domänen-Benutzer 0 Aug 27 10:32 materials/ -rwxrwxrwx+ 1 Administrators Domänen-Benutzer 1.1K Mar 13 2012 modifiedPostPattern_Baidu_serial_story.txt* -rwxrwxrwx+ 1 Administrators Domänen-Benutzer 1005 Aug 20 2012 modifiedPostPattern_BaiduNew_serial_story.txt* -rwxrwxrwx+ 1 Administrators Domänen-Benutzer 1.2K Mar 16 2012 modifiedPostPattern_Netease_againinput4.txt* CLi@PC-CLI-1 /cygdrive/d/tmp/tmp_dev_root/git/BlogsToWordpress $ pwd /cygdrive/d/tmp/tmp_dev_root/git/BlogsToWordpress CLi@PC-CLI-1 /cygdrive/d/tmp/tmp_dev_root/git/BlogsToWordpress $
3.想办法,都上传上去。
参考:
才知道,原来:
git add .
是添加当前文件夹内所有的文件的,所以去试试:
CLi@PC-CLI-1 /cygdrive/d/tmp/tmp_dev_root/git/BlogsToWordpress $ git add .
4.然后先搞懂git commit中-a和-m的含义:
5.通过:
.再去打算上传,但是上传之前,打算看看status能输出啥:
CLi@PC-CLI-1 /cygdrive/d/tmp/tmp_dev_root/git/BlogsToWordpress $ git status # On branch master # # Initial commit # # Changes to be committed: # (use "git rm --cached <file>..." to unstage) # # new file: BlogsToWordpress.py # new file: libs/crifan/blogModules/BlogBaidu.py # new file: libs/crifan/blogModules/BlogBlogbus.py # new file: libs/crifan/blogModules/BlogCsdn.py # new file: libs/crifan/blogModules/BlogDiandian.py # new file: libs/crifan/blogModules/BlogNetease.py # new file: libs/crifan/blogModules/BlogQQ.py # new file: libs/crifan/blogModules/BlogRenren.py # new file: libs/crifan/blogModules/BlogSina.py # new file: libs/crifan/blogModules/BlogSohu.py # new file: libs/crifan/blogModules/BlogTianya.py # new file: libs/crifan/blogModules/BlogXXX.py # new file: libs/crifan/crifanLib.py # new file: libs/thirdparty/BeautifulSoup.py # new file: libs/thirdparty/chardet/__init__.py # new file: libs/thirdparty/chardet/big5freq.py # new file: libs/thirdparty/chardet/big5prober.py # new file: libs/thirdparty/chardet/chardistribution.py # new file: libs/thirdparty/chardet/charsetgroupprober.py # new file: libs/thirdparty/chardet/charsetprober.py # new file: libs/thirdparty/chardet/codingstatemachine.py # new file: libs/thirdparty/chardet/constants.py # new file: libs/thirdparty/chardet/escprober.py # new file: libs/thirdparty/chardet/escsm.py # new file: libs/thirdparty/chardet/eucjpprober.py # new file: libs/thirdparty/chardet/euckrfreq.py # new file: libs/thirdparty/chardet/euckrprober.py # new file: libs/thirdparty/chardet/euctwfreq.py # new file: libs/thirdparty/chardet/euctwprober.py # new file: libs/thirdparty/chardet/gb2312freq.py # new file: libs/thirdparty/chardet/gb2312prober.py # new file: libs/thirdparty/chardet/hebrewprober.py # new file: libs/thirdparty/chardet/jisfreq.py # new file: libs/thirdparty/chardet/jpcntx.py # new file: libs/thirdparty/chardet/langbulgarianmodel.py # new file: libs/thirdparty/chardet/langcyrillicmodel.py # new file: libs/thirdparty/chardet/langgreekmodel.py # new file: libs/thirdparty/chardet/langhebrewmodel.py # new file: libs/thirdparty/chardet/langhungarianmodel.py # new file: libs/thirdparty/chardet/langthaimodel.py # new file: libs/thirdparty/chardet/latin1prober.py # new file: libs/thirdparty/chardet/mbcharsetprober.py # new file: libs/thirdparty/chardet/mbcsgroupprober.py # new file: libs/thirdparty/chardet/mbcssm.py # new file: libs/thirdparty/chardet/sbcharsetprober.py # new file: libs/thirdparty/chardet/sbcsgroupprober.py # new file: libs/thirdparty/chardet/sjisprober.py # new file: libs/thirdparty/chardet/universaldetector.py # new file: libs/thirdparty/chardet/utf8prober.py # new file: materials/BlogsToWordpress.ico # new file: modifiedPostPattern_BaiduNew_serial_story.txt # new file: modifiedPostPattern_Baidu_serial_story.txt # new file: modifiedPostPattern_Netease_againinput4.txt # CLi@PC-CLI-1 /cygdrive/d/tmp/tmp_dev_root/git/BlogsToWordpress $
很明显,是把所有的文件,都添加进来了:
6.然后再去commit:
CLi@PC-CLI-1 /cygdrive/d/tmp/tmp_dev_root/git/BlogsToWordpress $ git commit -a -m "first transfer from googlecode to sourceforge for BlogsToWordpress 2013-08-27" [master (root-commit) 7bfc4d2] first transfer from googlecode to sourceforge for BlogsToWordpress 2013-08-27 Committer: U-MM\CLi CLi@xxx Your name and email address were configured automatically based on your username and hostname. Please check that they are accurate. You can suppress this message by setting them explicitly: git config --global user.name "Your Name" git config --global user.email [email protected] After doing this, you may fix the identity used for this commit with: git commit --amend --reset-author 53 files changed, 27918 insertions(+), 0 deletions(-) create mode 100755 BlogsToWordpress.py create mode 100755 libs/crifan/blogModules/BlogBaidu.py create mode 100755 libs/crifan/blogModules/BlogBlogbus.py create mode 100755 libs/crifan/blogModules/BlogCsdn.py create mode 100755 libs/crifan/blogModules/BlogDiandian.py create mode 100755 libs/crifan/blogModules/BlogNetease.py create mode 100755 libs/crifan/blogModules/BlogQQ.py create mode 100755 libs/crifan/blogModules/BlogRenren.py create mode 100755 libs/crifan/blogModules/BlogSina.py create mode 100755 libs/crifan/blogModules/BlogSohu.py create mode 100755 libs/crifan/blogModules/BlogTianya.py create mode 100755 libs/crifan/blogModules/BlogXXX.py create mode 100755 libs/crifan/crifanLib.py create mode 100755 libs/thirdparty/BeautifulSoup.py create mode 100755 libs/thirdparty/chardet/__init__.py create mode 100755 libs/thirdparty/chardet/big5freq.py create mode 100755 libs/thirdparty/chardet/big5prober.py create mode 100755 libs/thirdparty/chardet/chardistribution.py create mode 100755 libs/thirdparty/chardet/charsetgroupprober.py create mode 100755 libs/thirdparty/chardet/charsetprober.py create mode 100755 libs/thirdparty/chardet/codingstatemachine.py create mode 100755 libs/thirdparty/chardet/constants.py create mode 100755 libs/thirdparty/chardet/escprober.py create mode 100755 libs/thirdparty/chardet/escsm.py create mode 100755 libs/thirdparty/chardet/eucjpprober.py create mode 100755 libs/thirdparty/chardet/euckrfreq.py create mode 100755 libs/thirdparty/chardet/euckrprober.py create mode 100755 libs/thirdparty/chardet/euctwfreq.py create mode 100755 libs/thirdparty/chardet/euctwprober.py create mode 100755 libs/thirdparty/chardet/gb2312freq.py create mode 100755 libs/thirdparty/chardet/gb2312prober.py create mode 100755 libs/thirdparty/chardet/hebrewprober.py create mode 100755 libs/thirdparty/chardet/jisfreq.py create mode 100755 libs/thirdparty/chardet/jpcntx.py create mode 100755 libs/thirdparty/chardet/langbulgarianmodel.py create mode 100755 libs/thirdparty/chardet/langcyrillicmodel.py create mode 100755 libs/thirdparty/chardet/langgreekmodel.py create mode 100755 libs/thirdparty/chardet/langhebrewmodel.py create mode 100755 libs/thirdparty/chardet/langhungarianmodel.py create mode 100755 libs/thirdparty/chardet/langthaimodel.py create mode 100755 libs/thirdparty/chardet/latin1prober.py create mode 100755 libs/thirdparty/chardet/mbcharsetprober.py create mode 100755 libs/thirdparty/chardet/mbcsgroupprober.py create mode 100755 libs/thirdparty/chardet/mbcssm.py create mode 100755 libs/thirdparty/chardet/sbcharsetprober.py create mode 100755 libs/thirdparty/chardet/sbcsgroupprober.py create mode 100755 libs/thirdparty/chardet/sjisprober.py create mode 100755 libs/thirdparty/chardet/universaldetector.py create mode 100755 libs/thirdparty/chardet/utf8prober.py create mode 100755 materials/BlogsToWordpress.ico create mode 100755 modifiedPostPattern_BaiduNew_serial_story.txt create mode 100755 modifiedPostPattern_Baidu_serial_story.txt create mode 100755 modifiedPostPattern_Netease_againinput4.txt CLi@PC-CLI-1 /cygdrive/d/tmp/tmp_dev_root/git/BlogsToWordpress $
7.再去看看remote的用法:
8.没太看懂remote add的含义,直接去执行吧:
CLi@PC-CLI-1 /cygdrive/d/tmp/tmp_dev_root/git/BlogsToWordpress $ git remote add origin ssh://[email protected]/p/blogstowordpress/code
好像在本地建立了一个远程的git。
9.再去看看push的用法:
10.然后上传上去,结果是出现timeout:
【总结】
等抽空解决了该问题,再继续参考官网的提示,去用git上传代码。