Git 开发基本流程与命令
2013-05-03 15:32
495 查看
从服务器克隆项目(178/gerrit)git clone root@192.168.2.178:/root/git_repository/xxx.git git clone ssh://account@192.168.2.178:29418/xxx.git 合并服务器的代码提交 git fetch origin branch_name git rebase origin/branch_name //推荐 提交本地代码到服务器 (178) git push origin branch_name 提交本地代码到服务器 (gerrit 代码审核服务器) git push origin branch_name:refs/for/branch_name 在现有本地仓库中添加远程仓库(178/gerrit) git remote add remote_name ssh://account@192.168.2.178:29418/xxx.git git remote add remote_name root@192.168.2.178:/root/git_repository/xxx.git | 本地仓库常用操作git branch -av //查看分支情况,a:全部分支,包括远程分支,v:显示分支最后一次提交信息 git branch branch_name //创建新的分支,一般开发新功能可创建分支feature-xxx,完成后在develop上rebase feature-xxx以实现合并 git add . //将变更添加到暂存区域 git commit -am 'commit message' //提交所有变更到本地仓库 git checkout branch_name //切换到指定分支 git merge branch_name //合并分支到当前分支 git rebase branch_name //rebase 分支 |
gerrit SSH Key 配置
打开终端,进入目录cd ~/.ssh 备份或移除现有ssh key $ ls # Lists all the subdirectories in the current directory # config id_rsa id_rsa.pub known_hosts $ mkdir key_backup # Makes a subdirectory called "key_backup" in the current directory $ cp id_rsa* key_backup # Copies the id_rsa keypair into key_backup $ rm id_rsa* # Deletes the id_rsa keypair 创建新的ssh key $ ssh-keygen -t rsa -C "your_email@youremail.com" # Creates a new ssh key using the provided email # Generating public/private rsa key pair. # Enter file in which to save the key (/home/you/.ssh/id_rsa): # Enter passphrase (empty for no passphrase): [Type a passphrase] # Enter same passphrase again: [Type passphrase again] # Your identification has been saved in /home/you/.ssh/id_rsa. # Your public key has been saved in /home/you/.ssh/id_rsa.pub. # The key fingerprint is: # 01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db your_email@youremail.com 全部完成后打开id_rsa.pub vim .ssh/id_rsa.pub 拷贝全部内容,包含邮件地址到Gerrit settings -> SSH Public Keys 输入后点添加 |
相关文章推荐
- 【前端知识点】GIT工作流程/步骤/基本命令
- Git基本操作流程和常用命令
- 分布式版本控制系统Git与项目托管平台Github相关概念、操作方法、开发流程与常用命令
- 【Git 使用笔记】第二部分:基本命令 和 单分支开发
- Git操作流程,基本命令演示
- [cnblogs镜像]Github 团队协作基本流程与命令操作 图解git工作流程
- GIT第二讲 基本操作流程和常用命令
- 【Git 使用笔记】第二部分:基本命令 和 单分支开发
- git开发流程、常用命令及工具、TortoiseGit使用及常见问题
- GIT第二讲的基本操作流程和常用命令
- 五步掌握Git的基本开发使用命令
- 五步掌握Git的基本开发使用命令
- git和mvn开发常用基本命令
- 五步掌握Git的基本开发使用命令
- Git 的基本操作、开发流程、实用技巧总结(陈彦贝)
- 【Git 使用笔记】第二部分:基本命令 和 单分支开发
- git学习【2】Git基本工作流程和常用命令
- Git操作流程,基本命令演示
- Git操作流程,基本命令演示
- Git操作流程,基本命令演示