Skip to content

Instantly share code, notes, and snippets.

@Jmzgit
Last active February 24, 2022 06:51
Show Gist options
  • Save Jmzgit/b65c5fb51daaa2534da22f0a89ba06dc to your computer and use it in GitHub Desktop.
Save Jmzgit/b65c5fb51daaa2534da22f0a89ba06dc to your computer and use it in GitHub Desktop.
No password to git remote acces via SSH
Cloning a GitHub repository with HTTPS || Cloning a GitHub repository using SSH.
If not: Change to SSH by cloning/fetching with GH SSH key

Then set SSH public/private keys in .ssh && Adding it to gh to have the connection local-origin
https://www.toolsqa.com/git/git-ssh-authentication/
About SSH Github docs
https://docs.github.com/en/authentication/connecting-to-github-with-ssh/about-ssh

in case: Reset server by doing a git clone of repo afterwards changing to SSH

$ git remote -v

Clone a repo

git clone <url>

Create a new branch, and switch to it

git checkout -b <branchname>

Switching to an existing branch

git checkout <branchname>

Adding files to be committed

git add <filename>

Commit your changes

git commit -m <commit message>

Pushing changes to remote

git push <remote> <branchname>

Rebase with a branch on remote

git fetch <remote> git rebase <remote>/<branchname>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment