git 安装,clone和提交
来源:互联网 发布:双十一淘宝购物技巧 编辑:程序博客网 时间:2024/06/08 12:22
一 :linux git install
1 configure in Gerrit:
Step for the user who don’t have git account, but will work on android projects:
- git 初次 config:
git config --global user.email "fabc@126c.om "
git config --global user.name "fabc" - Run “ssh-keygen -t rsa”
- login to http://1.2.3.4:8080/ with your windows account.
Find your name in the upper right corner, click settings
4. Make sure you can login gerrit web page with your account
$ ssh -p 29418 fabc@1.2.3.4
**** Welcome to Gerrit Code Review ****Hi fabc, you have successfully connected over SSH.
Unfortunately, interactive shells are disabled.
To clone a hosted Git repository, use:
git clone ssh://fabc@1.2.3.4:29418/REPOSITORY_NAME.git
notes: REPOSITORY_NAME.git need replace
5 login http://1.2.3.4:8080 ; choose project –--list-- --MediaRelayEngine
clone with commit-msg hook
git clone ssh://fabc@1.2.3.4:29418/MediaRelayEngine&& scp -p -P 29418 fabc@1.2.3.4:hooks/commit-msgMediaRelayEngine/.git/hooks/
git 原理: local work; push gerrit; gerrit submit git
6 git checkout -b ice_feature origin/ice_feature (switch ice_feature branch)(已经下载下来了,没有switch,所以git branch的时候没显示出来)
7 git branch (check which branch is on)
8 !提交
git pull
git diff
git commit -a -m "ice setting" (别忘了a,append,m是commit message;)
([ice_feature b96837a] add nodejs debug tool client
6 files changed, 539 insertions(+), 15 deletions(-)
这是正确的返回output )
git push origin HEAD:refs/for/ice_feature (HEAD is local; refs is remote; ice_feature 替换成自己的branch)
(remote: http://172.21.110.41:8080/1489
正确的output,会给出code review的web)
9 code review
http://1.2.3.4:8080
在open中,选中提交的package。进行review
10 不要采用和svn一样的做法,将本地文件a.cpp删掉,用git pull下载代码.
这样对git来说,认为是user向要delete这个文件,而不是pull这个文件,当user commit之后真变成在git 库上delete这个文件了.
如何恢复呢?
git 恢复到当前库上的new version
git reset --hard 6b33994a40e3ccea34e030767d68fd41bca5c89d
(change id is the newest submitted commitid)
11 其他git 常用命令
git status/ git log
二: windows install git
注意tortoisegit 和普通git 不同。
所以安装git的时候,选择不要安装与tortoisegit有关的任何东东.
- git 安装,clone和提交
- git clone时直接提交用户名和密码
- git clone与提交项目
- git的安装和提交
- git clone和其他
- GIT的安装和Clone到远程仓库
- 通过git clone安装caffe
- w7 安装git 和简单的提交
- git pull和git clone的区别
- 差异:git clone , git fetch, git pull和git rebase
- Git创建repository,以及clone,提交一个repository
- git 安装后的init、key、clone
- git clone
- git clone
- git clone
- git clone
- git clone
- git clone
- Linux FTP命令详解
- 树梅派上不了网问题
- Kotlin的Lambda表达式小结
- 心得
- Android----- MD5加密(登录注册得到与IOS相同的加密值,并且解决两个平台汉字加密不相同问题)
- git 安装,clone和提交
- spring循环引用
- IOS-UITabBarController
- 4419: [Shoi2013]发微博
- BLOCKBENCH:一种评估私有链的框架(上)
- JSON 的三种解析方式
- 【知识发现】【知识发现】隐语义模型LFM算法python实现(一)
- php检测字串是不是回文
- 暗黑的字符串