Push dialog defaults to /refs/tags/<branchname>

已回答

Sometimes when i create a new branch in my project de Push dialog defaults to push my new branch to /refs/tags/<branchname> which creates a tag with the branchname.

I wish to push to the branch, not create a tag.

How do I change this? I can manually change this, but I have to remember to do this every time. The default should be push to the branch.

0

Hi,

Check by command: git branch -vv, most likely this one is tracked by default in git and has to be changed. 

0

Not sure what I'm suppose to see there

This looks good to me

0

If you go to git config file, (in your .git folder), are there any pushURL or fetch values defined? 
If so, replace them with refs/heads instead of tags. 

0
[core]
	repositoryformatversion = 0
	filemode = false
	bare = false
	logallrefupdates = true
	symlinks = false
	ignorecase = true
[submodule]
	active = .
[remote "origin"]
	url = git@github.com:****/****.git
	fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
	remote = origin
	merge = refs/heads/master

this is my git config for the project

0

Does it always reproduce?

Can you share the screenshot of branch popup window? 

How does it reproduce for the newly created branch? Do you push it and then it appears? 

 

Also, another thing to note, your CMD shows that development branch is pushed and tracked but your local git config does not have this. 

Can you check your global git config? Is the branch defined there? 

0

Does it always reproduce?

For this project yes, I have this issue on some other projects, but not always

Can you share the screenshot of branch popup window? 

How does it reproduce for the newly created branch? Do you push it and then it appears? 

When I click the ‘Push..’ button (or Ctrl + Shift + K), then it's wrong. I've tried restarting PHPStorm multiple times, still the same issue.

Also, another thing to note, your CMD shows that development branch is pushed and tracked but your local git config does not have this. 

Can you check your global git config? Is the branch defined there? 

My global git config

[winUpdater]
	recentlySeenVersion = 2.25.0.windows.1
[user]
	name = Jerôme Bakker
	email = *****@****
[core]
	excludesfile = C:\\Users\\***\\.gitignore
	autocrlf = true
	eol = lf
[filter "lfs"]
	clean = git-lfs clean -- %f
	smudge = git-lfs smudge -- %f
	process = git-lfs filter-process
	required = true
[init]
	defaultBranch = master
0

This is quite strange. 

git branch -vv shows that you have both master and development pushed and tracked, while both git local config file and global file have no information about “development” branch.

Is the development branch currently pushed? Can you do git branch -vv inside the IDE terminal? 

0

Is the development branch currently pushed?

yes

Can you do git branch -vv inside the IDE terminal? 

I did that the first time, so the result can be found above

0

I did a recheck of the project git config file, today it looked like

[core]
	symlinks = false
	repositoryformatversion = 0
	filemode = false
	logallrefupdates = true
[remote "origin"]
	url = git@github.com:***/***.git
	fetch = +refs/heads/*:refs/remotes/origin/*
	push = refs/heads/master:refs/heads/master
	push = refs/tags/*:refs/tags/*
[branch "master"]
	remote = origin
	merge = refs/heads/master
[branch "development"]
	remote = origin
	merge = refs/heads/development

I don't know if i maybe shared the wrong config????

I changed

push = refs/heads/master:refs/heads/master to push = refs/heads/*:refs/heads/*

And now it works ;)

0

hooray, :D That was it then. Thanks for the update. 

0

请先登录再写评论。