您的位置:首页 > 其它

Git从创建到推送到远程版本库

2015-02-02 16:15 183 查看
1、创建一个新的文件夹,并进入到该文件夹里,使用命令:git init来创建新的git仓库;

2、获取钩子(每次git init之后都要一次): scp -p -P 8849 lining@ip:hooks/commit-msg .git/hooks/

3、从远程仓库中把代码克隆到本地,检出仓库:

本地仓库的克隆:git clone /path/to/repository

远程仓库的克隆:git clone username@host:/path/to/repository

4、创建分支:git branch ‘分支名称’

5、添加到缓存区:git add <filename>

6、提交到本地版本库:git commit -m "代码提交信息"

7、推送到远程版本库:git push origin master
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: