A
A
aleksandrkotov2022-02-05 14:09:50
git
aleksandrkotov, 2022-02-05 14:09:50

How to clone a branch to your home computer via ssh if local development was done on another computer?

Just started working at my first job. And we have this principle of work:
There is a develop branch. For each individual task, a new branch is created from the develop branch, after the task is completed, a push is made to the github via SSH, a pull request is made there and the mentor, after checking the task, merges the task branch into develop, after which I do git pull origin develop on the working computer.

But on Friday, I didn’t have time to do one task at work. I want to create a task branch on my home computer, and after the task is completed, push to github and pull request.

First, I clone the branch from the repository:

git clone -b develop [email protected]:someuser/somereposytory.git my_folder

And of course I get an error:
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.


As I understand it, you need to somehow configure SSH and use the key that I generated at work and added to github:
61fe586645cb6114693268.png

Tell me what steps I need to take so that I can clone branches from a remote repository, and push new branches created on my home computer to the github repository using ssh?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Karabanov, 2022-02-05
@aleksandrkotov

Generate an SSH key on your home computer ssh -t ed25519
Add the public part of the key to your GitHub account
After that, you can clone.
Each device must have its own key. The private key must not leave the device on which it was generated.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question