相关疑难解决方法(0)

origin/branch_name和branch_name之间的区别?

推送到bitbucket.

如果我这样做:git push origin origin/branch_name我的提交没有被推送.

Total 0 (delta 0), reused 0 (delta 0)
Run Code Online (Sandbox Code Playgroud)

如果我做git push origin branch_name我的提交被推送:

Counting objects: 160, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (13/13), done.
Writing objects: 100% (20/20), 2.10 KiB | 0 bytes/s, done.
Total 20 (delta 6), reused 0 (delta 0)
Run Code Online (Sandbox Code Playgroud)

那么branch_name前面的起源/平均值是多少?为什么这很重要?

git bitbucket

19
推荐指数
1
解决办法
1万
查看次数

在Jenkinsfile中检查不同的分支是不可能的吗?

我在BitBucket上有两个分支:masterdevelop.我还在Jenkins服务器上配置了BitBucket Team Folder作业来构建该存储库.在develop分支上有以下Jenkinsfile:

node {
    stage('Checkout') {
        checkout scm
    }

    stage('Try different branch') {
        sh "git branch -r"
        sh "git checkout master"
    }
}
Run Code Online (Sandbox Code Playgroud)

当Jenkins运行它时,构建在尝试签出时失败master:

[Pipeline] stage
[Pipeline] { (Try different branch)
[Pipeline] sh
[e_jenkinsfile-tests_develop-4R65E2H6B73J3LB52BLACQOZLBJGN2QG22IPONX3CV46B764LAXA] Running shell script
+ git branch -r
  origin/develop
[Pipeline] sh
[e_jenkinsfile-tests_develop-4R65E2H6B73J3LB52BLACQOZLBJGN2QG22IPONX3CV46B764LAXA] Running shell script
+ git checkout master
error: pathspec 'master' did not match any file(s) known to git.
[Pipeline] }
Run Code Online (Sandbox Code Playgroud)

我所预料的git branch -r命令打印出两个origin/master …

git bitbucket jenkins jenkins-pipeline

12
推荐指数
3
解决办法
3万
查看次数

如何获取所有远程分支?

不知何故,我的一个存储库拒绝获取新分支:

C:\temp>git fetch --all
Fetching origin

C:\temp>git branch -a
* develop
remotes/origin/develop

C:\temp>git ls-remote --heads origin
d130c97c1ccbe9ab35cd6e268c760781e37e3628 refs/heads/2.1.0.x
...
92685125df152fe053a2818de0c4d2ce8655c6b8 refs/heads/2.2.5.x
1e2eec16c7d63c84d6b53d0a221d22109b4de2a8 refs/heads/develop
f6447d5315fe777803b283bee7dac1dbdba92536 refs/heads/feature/0001089__icons_are_gone_-_move_inclusion_to_RC_files
e2cf0112b7e7fc18eb3467c7c42657208147efb2 refs/heads/feature/0001102__Debug_time_fix_exception_EIdSocketError_10060
6b2c89c6a39b3ce26cf42c5e8e5e0dd12c88abac refs/heads/feature/0001103__Research_cause_of_Internal_error_Stack_not_balanced
...
9f724b76b7c3533996fa03189e18a2f61fa5cf4f refs/heads/master
c233696172eb05522d1bb6705a3ea8cd730a762d refs/heads/origin/master
1db38f4fab2c41ee1931c9c6165aa6087556210a refs/heads/release
c233696172eb05522d1bb6705a3ea8cd730a762d refs/heads/trunk
Run Code Online (Sandbox Code Playgroud)

我如何强制git获取所有这些远程分支?

我在git version 2.8.2.windows.1.

git

6
推荐指数
1
解决办法
5782
查看次数

如何解决“git checkout分支”与git已知的任何文件不匹配的问题?

bitbucket 上有一个存储库,我有一个分支。

当我写: 时git branch -a,我只得到我当前的分支,它没有列出其他分支。

当我写时git checkout branch_name,我得到:error: pathspec 'branch_name' did not match any file(s) known to git

git remote show origin

* remote origin
  Fetch URL: ssh:URL
  Push  URL: ssh:URL
  HEAD branch: master
  Remote branch:
    branch_name tracked
  Local branch configured for 'git pull':
    branch_name merges with remote branch_name
  Local ref configured for 'git push':
    branch_name pushes to branch_name (up to date)
Run Code Online (Sandbox Code Playgroud)

git branch --all -vv

* branch_name                {an id} [origin/branch_name] A …
Run Code Online (Sandbox Code Playgroud)

git

3
推荐指数
1
解决办法
2万
查看次数

标签 统计

git ×4

bitbucket ×2

jenkins ×1

jenkins-pipeline ×1