最近开始使用git管理源代码,同时讲源码托管到github上,关于git的最详细介绍见“廖雪峰的官方网站”
http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000
这里我就介绍最简单的代码远程推送和本地拷贝:
远程推送:
1.git init
2.git add README.md
3.git commit -m "first commit"
4.git remote add origin https://github.com/srf1986/im6q_os_platform.git
5.git push -u origin master
在你需要管理的源码目录下使用git init 创建git管理,
将你要管理的文件,git add 这里是“README.md”添加到临时库中,
将你的文件写入到git 中,git commit -m "first commit" 其中“first commit”为你对这次提交的版本进行版本说明
讲本地内容进行远程推送git remote add origin https://github.com/srf1986/im6q_os_platform.git 其中https://github.com/srf1986/im6q_os_platform.git为我在github中建的仓库,本句话基本上对一个源码使用一次即可,目的就是确定推动的目的地
提交你的源码,git push -u origin master
远程拷贝到本机
进入到你想保存文件的文件夹中,使用git clone https://github.com/srf1986/emacs23-config-file即可。