我是新手git,我在练习.我创建了一个本地分支,但是当我完成时,我看到git push我的分支没有上传到存储库.我必须这样做:git push -u origin --all.
为什么是这样?不是分支是默认推送的新变化吗?为什么我需要运行第二个命令?
我在使用Jenkins + Gerrit时遇到了麻烦.
这是我到目前为止所得到的:
Jenkins中的Gerrit Trigger配置似乎没问题:当我推出一个新的变更集时,会启动Jenkins构建.
我用过这个: Jenkins:Gerrit Trigger问题的 设置也能够"手动"启动它.
至于我的配置,我有这样的东西:https://stackoverflow.com/a/18347982/2248987.Branch Specifier是$ GERRIT_BRANCH,Ref Spec是$ GERRIT_REFSPEC
Gerrit和Git正在自行处以罚款.访问似乎也可以.
这是我的问题.构建时(gerrit触发或手动),日志输出为:
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url ssh://user@host:29418/testproject # timeout=10
Fetching upstream changes from ssh://user@host:29418/testproject
> git --version # timeout=10
using GIT_SSH to set credentials
> git -c core.askpass=true fetch --tags --progress ssh://user@host:29418/testproject refs/heads/master
> git rev-parse origin/$GERRIT_BRANCH^{commit} # timeout=10
> git rev-parse $GERRIT_BRANCH^{commit} # timeout=10
ERROR: Couldn't find …Run Code Online (Sandbox Code Playgroud) 我对Jenkins(和Stackoverflow)完全陌生,并且正在设置一个简单的Jenkins作业以轮询git存储库。
1)我在本地计算机上创建了一个git存储库。2)我创建了一个Jenkins Freestyle作业,并在配置屏幕上输入了以下参数:
资料库URL:media@127.0.0.1:/ home / media / git_repo_remote凭证:无
在“存储库URL”文本字段下显示以下错误:
Failed to connect to repository : Command "git ls-remote -h media@127.0.0.1:/home/media/git_repo_remote HEAD" returned status code 128:
stdout:
stderr: Host key verification failed.
fatal: Could not read from remote repository.
Run Code Online (Sandbox Code Playgroud)
请确保您具有正确的访问权限,并且存储库存在。
然后,我将资源库URL更改为“ https:///127.0.0.1/home/media/git_repo_remote ”,并在日志中收到以下内容:
Started by an SCM change
Building in workspace /var/lib/jenkins/workspace/First Job
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url https:///127.0.0.1/home/media/git_repo_remote # timeout=10
Fetching upstream changes from https:///127.0.0.1/home/media/git_repo_remote
> git …Run Code Online (Sandbox Code Playgroud)