git创建远程仓库
来源:互联网 发布:ipad 淘宝卖家 编辑:程序博客网 时间:2024/04/29 11:27
对于版本管理用了很多,最开始用的微软的VSS,那个同一时间只能一个人操作,就是一个人把代码从服务器拿出来代码就被锁定了,其他人不能拿代码了,这个效率最低。
后面开始接触CVS,一下感觉功能比VSS强大了很多,可以很多人同时一起工作,相互不干扰,当时觉得这个已经很强大了。
做了手机接触了SVN,和CVS相比,界面的友好性强了很多。做智能机后接触了git,这个上传比SVN方便,所以最后选择用这个。
1.准备好本一份干净的本地代码,不要的文件全删除,然后执行git init。
dsxsw01@dsxadmin-desktop:~/git/idh.code$ git initInitialized empty Git repository in /home/dsxsw01/git/idh.code/.git
2.执行完第一步之后,现在在你的本地代码目录下已经建了一个空的git 仓库。可以用git status看下:
dsxsw01@dsxadmin-desktop:~/git/MocorDroid4.4_3.10_14A_W14.19.1_P14.30.2$ lunchYou're building on LinuxLunch menu... pick a combo: 1. aosp_arm-eng 2. aosp_x86-eng 3. aosp_mips-eng 4. vbox_x86-eng 5. aosp_manta-userdebug 6. mini_armv7a_neon-userdebug 7. mini_x86-userdebug 8. mini_mips-userdebug 9. scx15_sp6815eabase-userdebug 10. scx15_sp6815eaplus-userdebug 11. scx15_sp6815eaplus_UUI-userdebug 12. scx15_sp6815eatrisim-userdebug 13. scx15_sp7715eabase-userdebug 14. scx15_sp7715eaplus-userdebug 15. scx15_sp7715eacuccspecAplus_UUI-userdebug 16. scx15_sp7715eaplus_dt-userdebug 17. scx15_sp6815gabase-userdebug 18. scx15_sp6815gaplus-userdebug 19. scx15_sp6815gaplus_UUI-userdebug 20. scx15_sp6815gatrisim-userdebug 21. scx15_sp7715gabase-userdebug 22. scx15_sp7715gaplus-userdebug 23. scx15_sp7715gaplushvga-userdebug 24. scx15_sp7715gacuccspecAplus_UUI-userdebug 25. scx15_sp7715gaplus_UUIhvga-userdebug 26. aosp_hammerhead-userdebug 27. aosp_mako-userdebug 28. aosp_tilapia-userdebug 29. aosp_flo-userdebug 30. aosp_grouper-userdebug 31. aosp_deb-userdebug
3.git add . 把所有的文件加入到缓存里面。
4.执行git commit -m"注释",双引号是你这次commit的注释,本地操作暂时告一段落。
5.切换到服务器,进入你要存放git仓库的文件夹,在那里新建一个文件夹,例如我的是sc7715_P14.30.2_P2.git,为方便以后管理,我把这个文件夹所属的组改为dsxsw组,就是我们公司的软件组,每个软件工程师都属于这个组。
chgrp -R dsxsw sc7715_P14.30.2_P2.git/
6.进入刚才你创建的那个目录,执行git init --bare。
7.在切换回本地计算机,在你的代码目录下执行git remote add origin 远程计算机地址:/git仓库目录路径/仓库名,例如我的是git remote add origin 192.168.1.80:/usr/dsx_server/git_root/sc7715_P14.30.2_P2.git。
8.最后一步就是把代码上传到服务器了,执行git push origin master。
- git 创建远程仓库
- git 创建远程仓库
- git创建远程仓库
- git 创建远程仓库
- git 创建远程仓库
- git-创建远程仓库
- git 创建远程仓库
- 创建Git远程仓库
- git 创建远程仓库
- git创建远程仓库
- git如何创建远程仓库
- git 创建远程仓库详解
- 基于本地文件或者本地Git仓库创建远程Git仓库
- git 常用命令(创建仓库到远程送到)
- Git采用SSH协议创建远程仓库
- git创建分支添加远程仓库上传
- (转载)git 创建远程仓库详解
- git 远程仓库创建和代码上传
- 如何使用HTML5实现利用摄像头拍照上传功能
- Android Fragment总结
- 【jQuery】使用JQ来编写面板的淡入淡出效果
- SVN提交报错,clean up报错
- Time.deltaTime
- git创建远程仓库
- SQL集锦
- 一致性hash算法 - consistent hashing
- 我学习java的经历
- XFire+Spring构建WebService接口服务端备忘<入门篇>
- StructLayout(LayoutKind.Sequential)——c#
- 考虑用静态工厂方法代替构造器
- 如何在xcode中使用storyboard
- 陈昊芝--Great or nothing