ssh-keygen -t rsa -C "youremail@example.com" 路径以下 /Users/zhouqirui/.ssh/id_rsa
//路径 sudo nano /etc/ssh/ssh_config //增长以下内容 MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160 HostkeyAlgorithms ssh-dss,ssh-rsa KexAlgorithms +diffie-hellman-group1-sha1
//项目根目录下配置GIT git config remote.origin.push refs/heads/*:refs/for/*
// 使用 git push // 备注: (能够使用,但多分支下,回报错) YW20170821003:IOS zhouqirui$ git push Total 0 (delta 0), reused 0 (delta 0) remote: Processing changes: refs: 2, done To ssh://172.18.200.198:29418/IOS ! [remote rejected] feature/raychow_develop -> refs/for/feature/raychow_develop (no new changes) ! [remote rejected] master -> refs/for/master (duplicate request) error: failed to push some refs to 'ssh://zhouqirui@172.18.200.198:29418/IOS' // 使用 git push origin HEAD:refs/for/master // 备注: 一直报错.. YW20170821003:IOS zhouqirui$ git push origin HEAD:refs/for/master Total 0 (delta 0), reused 0 (delta 0) remote: Branch refs/heads/refs/for/master: remote: You are not allowed to perform this operation. remote: To push into this reference you need 'Push' rights. remote: User: zhouqirui remote: Please read the documentation and contact an administrator remote: if you feel the configuration is incorrect remote: Processing changes: refs: 1, done To ssh://172.18.200.198:29418/IOS ! [remote rejected] HEAD -> refs/for/master (prohibited by Gerrit) error: failed to push some refs to 'ssh://zhouqirui@172.18.200.198:29418/IOS' //使用 git-review 代替,见下问
'更正上一次提交' 选项 该用法确保使用上一次记录从新提交,使用上次生成惟一 commit ID
//1.最近2条记录 git rebase -i HEAD~2 //2.合并改写 (退出命令 esc :wq) pick b0f97ef7d c1 squash a61e4a8fb c2 # Rebase 8df25e817..a61e4a8fb onto 8df25e817 (2 commands) # # Commands: # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash = use commit, but meld into previous commit # f, fixup = like "squash", but discard this commit's log message # x, exec = run command (the rest of the line) using shell # d, drop = remove commit # # These lines can be re-ordered; they are executed from top to bottom. # # If you remove a line here THAT COMMIT WILL BE LOST. # # However, if you remove everything, the rebase will be aborted. # # Note that empty commits are commented out //3. 查看记录 git log //4.正常提交
推荐使用这个办法配置 sourectree 快捷操做作处理。路径必须指定对应分支,格式以下: git push ssh://zhouqirui@192.168.31.65:29418/IOS HEAD:refs/for/develop
网上提示使用以下做提交,然而本人测试不管如何都没法单个分支提交成功.全部找了 git-review 替代 git push git push origin HEAD:refs/for/master
参考github
brew install git-review
//新建文件 nano .gitreview //设置 git review -s //使用 在要提交的分支下使用,而且配置文件要统一,有错误就按提示作处理就能够了. git review //等待审核
[gerrit] host=172.18.200.198 port=29418 project=IOS defaultbranch=master ## 这个路径要对应不一样仓库处理
更详细说明请点击shell