1

How I can change my git bash default port 22 to 443.Why I want to change?Our local internet policy not allowed to use that port and I got my error of bad file with fatal error when I am cloning to a project.I heard that I can use putty.But I am not sure that I already tested with putty and I was not ok with it.I use SmoothWall Express 3.0-polar-i386 and I set 22 # ssh and is also not working. Please let me know if others methods can help me.

Thanyawzinmin

1
  • What is a "git bash"?
    – womble
    Jul 29, 2011 at 12:42

3 Answers 3

1

if you are using ssh use the .ssh/config file

or in Linus words

4
  • Wouldn't you need to have the server configured to have ssh listen on port 443? What about if it is already listening on 443 for HTTPS?
    – pferate
    Jul 29, 2011 at 5:48
  • Yes, the ssh server or http/https need to be configured to use git
    – Aragorn
    Jul 29, 2011 at 5:59
  • But you would only be able to use one of the services at a time on that port. I think this would only be viable if OP has control over the server and does not need HTTPS on the standard port.
    – pferate
    Jul 29, 2011 at 6:13
  • I use smooth wall server and I changed 443#https to 443#ssh.I deleted 22#ssh also.And now I am watching the results. Oct 1, 2011 at 10:24
1

The port that you communicate on depends on how the Git server you are connecting to is configured. It will have to allow access over HTTPS.

For configuring the server, you can take a look at the "HTTP/S" section in "Git on the Server" chapter in the Pro Git book for more information.

When you clone the repository locally, you can use the syntax:

$ git clone http://example.com/gitproject.git

or

$ git clone https://example.com/gitproject.git

Edit:

Here is a tutorial on Setting up a git repository which can be pushed into and pulled from over HTTP(S).

7
  • I agree with pferate and I used his method Jul 29, 2011 at 6:23
  • Then I got another error failed to connect to repo with port 443. Jul 29, 2011 at 6:23
  • I changed config file with a line of text prot 443!What can I do more? Jul 29, 2011 at 6:24
  • What config file did you change?
    – pferate
    Jul 29, 2011 at 6:48
  • I change repo/.git/config Jul 29, 2011 at 6:52
0

Try to change to 443 in ~/.ssh/config.

  1. In ubuntu, change the port on:

    sudo nano ~/.ssh/config
    

See my other answer on using that for GitHub in here

2
  • No, don't. SSH uses 22. HTTPS uses 443. Git works fine over both https and ssh. But they are different protocols. Services such as Github and Azure Devops offer both.
    – vidarlo
    Nov 17, 2022 at 7:12
  • @vidarlo his question is about "how" and we are in the similar situation. My campus bock ssh at port 22 and I was able using ssh after changing to port 443. After a year, they block ssh at port 443, but when reverting to 22, it just works. Nov 17, 2022 at 22:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .