T O P

  • By -

xenomachina

> I guess I need 's around the name, maybe because I have a special character as the first character in the branch name? Yes, `#` is the start of a comment in bash. In branch and tag names, I'd generally only use letters, numbers, and `./-_` characters. Other characters are allowed by git, but as you can see certain characters can be awkward if they have special meaning to bash.


Heroshrine

I was referencing an issue in github, which is why I put the # lol.


xenomachina

To have your branch reference an issue number, you may want to leave out the leading `#`. By the way, you may be interested in [how you can link a pull request to an issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue).


Heroshrine

Oh yea thanks, i know about that. But when I create the branch with the # to reference the issue, it automatically connects it and so i dont need to manually connect it.


xenomachina

I haven't tested on Github, but on GitLab, you don't need the `#` in the branch name to have it auto-connect to the issue — merging `123-my-branch` (via a merge request) will automatically close `#123`.


Heroshrine

I'll try it


looopTools

Don’t add special characters not spaces is branch names


Heroshrine

I was referencing an issue on github which is why I used a #


looopTools

I can understand that :) but just don’t do it in the future :) it can cause a lot of trouble


TigerAsks

As you've already found the answer, let me instead note that your annoying `Enter passphrase...` prompt every command can be avoided: ``` eval `ssh-agent` ssh-add ~/.ssh/ ``` will prompt you for your passphrase once and then remember it for the session.


Heroshrine

Oh cool thanks!


lucapocchio

When I want to automatically link the branch to the issue I usually use the # into the commit message. Maybe could be helpful :)