# Connectiong by SSH from Android Termux to Desktop and vice-versa.md
# Copyright (c) 2019 Evandro Coan
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
When you use git from the command line, use the following steps:
- On Windows, launch Git Bash, on MacOS or Linux, launch a terminal.
- If you have not done so on your machine, create a COMP167 directory in your home directory using
mkdir ~/COMP167
- NOTE: This command only needs to be run once on each machine, to create the directory.
- Navigate to your directory using
cd ~/COMP167
. - If your repository already exists locally, navigate to it using
cd [your-repository-name]
, if you want to check the contents of your directory, usels
. - If your repository does not exist locally, get the clone link from the "Clone or Download" button on the GitHub Repository.
github recently switched to an https scheme as the default for cloning repos. as a side effect you may suddenly be prompted for a 'Username' and 'Password' when you push where, previously, you were able to do so without typing in credentials. the solution is to cause git to cache https credentials which is easy, since git uses curl under the covers
in your home directory create a file called '.netrc', for example
/Users/ahoward/.netrc
in it put these contents
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Host github.com | |
User git | |
Hostname github.com | |
PreferredAuthentications publickey | |
IdentityFile /home/user/.ssh/id_rsa |