![]() ![]() ![]() I just enabled nat loopback on my router and now I can uniformly access my computer using the external name/port. I have only one remote in my git config file which looks like įetch = +refs/heads/*:refs/remotes/origin/*ĮDIT : I just found out that I dont have to do all this. ![]() The name is what we give to the connection. One could automate even this by writing a script which is triggered by changes in the network. To create a new remote connection we use the git remote add name url command. You can also add the other repository with git remote add, then use git. In this case, when adding a new repository, specify the URL of the remote repository in the SSH format. I have a script that adjusts the contents of ~/.ssh/config when I move to a new location. You can specify the remote repository with a URL as shown, or with a simple. You can use SSH to connect to the remote Git repository. The last one is not needed if you don't use keys) Push the code in your local repository to. (please adjust he last two values accordingly. You can see the remote as GitHub in this case, and GitHub provides the URL for adding to the remote repository. Advertisement bash git checkout master Switched to branch master Your branch is up to date with origin/master. You will be required to enter the remote URL in the next step. To set a remote URL from a local repository use the git remote add command as demonstrated below: We will use the master branch in the git-url project for this example.Please make sure to note the remote URL (GitHub and Bitbucket) for your repo. You can keep multiple versions of ~/.ssh/config depending on the number of situations.įor example, in my case at home I access my server with hostname as my-fancy-server and port as 22.Īt office, the hostname is my-dyndns-name and the port name is XXX. The remote URL for a GitHub repo looks like this. For GitHub, this URL can be found on the repository page by clicking on the Code button. It works even if you have two different port numbers (not just hostnames) to access the same machine from two different locations. The remote URL can be found on the repository page. This approach is inspired by Stickley's answer. ![]()
0 Comments
Leave a Reply. |