Questions tagged [git-refspec]

Use git-refspec for questions related to the the mapping between a local branch name and a remote branch name.

References

37 questions
3997
votes
137 answers

Message 'src refspec master does not match any' when pushing commits in Git

I clone my repository with: git clone ssh://xxxxx/xx.git But after I change some files and add and commit them, I want to push them to the server: git add xxx.php git commit -m "TEST" git push origin master But the error I get back is: error: src…
sinoohe
  • 40,334
  • 3
  • 19
  • 16
790
votes
6 answers

What is git tag, How to create tags & How to checkout git remote tag(s)

when I checkout remote git tag use command like this: git checkout -b local_branch_name origin/remote_tag_name I got error like this: error: pathspec origin/remote_tag_name did not match any file(s) known to git. I can find remote_tag_name when I…
Ryanqy
  • 8,476
  • 4
  • 17
  • 27
92
votes
2 answers

Git - What is "Refspec"

I've been following this guide on configuring GitLab continuous integration with Jenkins. As part of the process, it is necessary to set the refspec as follows: +refs/heads/*:refs/remotes/origin/*…
user4832990
59
votes
9 answers

git push error: src refspec main does not match any on linux

whenever I'm trying to upload my files using git push -u origin main I'm getting error which is as follows error: src refspec main does not match any error: failed to push some refs to 'github.com:xxxxxx/xxx-project.git' but if I do git push -u…
Arka
  • 957
  • 1
  • 8
  • 18
18
votes
1 answer

What are the dos and don'ts of custom objects and refs?

Let's say I want to write a small helper that allows to append some metadata to a repository in a way that can propagate to clones via refs. Simple example (a git-notes clone prototype that doesn't even attach the notes to any other git…
Tobias Kienzler
  • 25,759
  • 22
  • 127
  • 221
7
votes
3 answers

error: cannot update the ref 'refs/remotes/origin/xyz': unable to create directory for '.git/logs/refs/remotes/origin/xyz': No such file or directory

I am facing below issue while taking fresh pull. (git pull) error: cannot update the ref 'refs/remotes/origin/xyz': unable to create directory for '.git/logs/refs/remotes/origin/xyz': No such file or directory I have checked particular location…
VVB
  • 7,363
  • 7
  • 49
  • 83
4
votes
1 answer

Git refs - why is it called heads instead of branches?

Just curious when you look in the git/refs directory: .git/refs/heads .git/refs/tags why is it called refs/heads instead of refs/branches?
user11810894
3
votes
1 answer

Git track different branches for push and pull?

I have a Git repository which is being managed with Gerrit, where you don't push to , but instead push to refs/for/, and then magic happens. Thus, I'd like different behavior for git pull and git push. In particular, I want git pull…
joshlf
  • 21,822
  • 11
  • 69
  • 96
2
votes
2 answers

git refs/pull/... vs. pull/

In various places, looking for instructions on how to create a local branch from a GitHub Pull Request, I have seen two versions: git fetch upstream refs/pull/PR_ID/head:NEW_LOCAL_BRANCH and git fetch upstream pull/PR_ID/head:NEW_LOCAL_BRANCH My…
Daniel Goldfarb
  • 6,937
  • 5
  • 29
  • 61
2
votes
0 answers

Delete lfs files from GitHub repo

I have a github repo with around 1.7GB of lfs storage used for which I am paying the upgraded storage plan. Me and my group of 6 other people used this repo during a university games project, they all made forks of it and made pull requests into the…
hans002
  • 21
  • 1
2
votes
0 answers

Terraform modules source using both a ref for branch and tag

I am trying to determine if it is possible to specify both a matching branch and a tag when declaring a module in terraforming. In the Terraform Docs it notes that branch or tag can be used in the source for a module. module "vpc" { source =…
2
votes
1 answer

Why does Git only store branches under refs/remotes/origin?

After looking at Git tags and seeing how they are propagated and how many workarounds there are to pruning them, I concluded that the best fix would be to change the structure of refs/remotes/origin/. So, why are refs under refs/remotes/origin/…
nonsensickle
  • 4,438
  • 2
  • 34
  • 61
2
votes
2 answers

Ignore a single namespace in git refspec

Consider the following repository. It has a lot of private branches for team members, all under the refs/heads/team/ namespace, that I do not want to fetch, but I still do want to fetch all the rest, including any possibly newly created branches…
2
votes
1 answer

How does Gerrit implement its ‘magical’ refs?

I am currently implementing Gerrit as central code review system. In the process of trying to understand the ins and outs of Gerrit, I got stuck at the sentence below. Taken from the Gerrit documentation: As Gerrit implements the entire SSH and Git…
Tim
  • 23
  • 3
2
votes
1 answer

Does a Git a push configuration allow specifying the branch as well?

I have a branch which pulls from one remote and pushes to another and U used git branch --set-upstream-to=xxxx xxxx to set the pull repo and git config remote.origin.pushurl user@user.com:repo.git to set the push repo. Although the pull is from the…
vfclists
  • 19,193
  • 21
  • 73
  • 92
1
2 3