Use two GitHub accounts on the same computer

Many developers have multiple GitHub accounts. One for personal projects, and another one for their work or business. There is a way to access multiple accounts simultaneously from the same computer. Only one account at a time can be configured using the HTTP connection, but we can configure the rest of the accounts using SSH. There are …

Add SSH key access to a GitHub repository

Generate an SSH key pair In a terminal execute ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key : /Users/MY_USERNAME/Git/_Keys/MY_PROJECT/MY_PROJECT_rsa_ci Enter passphrase (empty for no passphrase): Enter same passphrase again: Leave the passphrase empty, many systems cannot work with password protected key pairs. This process will save the key-pair in …

Install Git on Windows

If you use two-factor authentication see Create a Personal Access Token to use it as password in the command line tools at Switching to 2-factor authentication in GitHub Navigate to https://git-scm.com/download/win to download Git for Windows. The page automatically downloads the installer for the operating system you use. Install the application Accept the default values, including these: Make …

Display all teams you belong to in GitHub

To get the information on all teams you are part of in Github Open a Terminal window Execute this command with your Personal Access Token curl -H “Authorization: token YOUR_PERSONAL_ACCESS_TOKEN” https://api.github.com/user/teams The returned JSON will display all information on the teams you belong to. To generate a personal access token See Create a Personal Access Token …

GitKraken installation and configuration

GitKraken is a Git user interface to manage Git repositories. Installation Download the GitKraken installer from https://www.gitkraken.com/download Configuration Start the GitKraken application Login with your GitHub account, or create a new account or Connect to a Git repository Click the Open a Repository button Select a repository folder and click the Open button

Custom Git Status and Git Pull commands to work with all of your repositories

If you work with many Git repositories it is easy to miss a repository when you commit your changes, and very time consuming to pull from all repositories. It is easy to automate both processes. In this example, we will place all files in the ~/Git/devops-scripts folder. If you want to place your files at another …

Add SSH key to a Jenkins Git step

To access a Git repository Jenkins can use an SSH key. To add the SSH key to the Jenkins server use the following Chef script Store the SSH key in an encrypted data bag called “keys”. { “id”: “ci_private_keys”, “ci_github_key”: “—–BEGIN RSA PRIVATE KEY—–\n…\n—–END RSA PRIVATE KEY—–“, }   Add the following to the Jenkins …

How to edit the GitHub README.md file

The GitHub repositories usually contain a README.md file to describe how to use the project. The GitHub web site has a simple editor, but it has a few limitations If you accidentally refresh the page, you lose your changes, The preview pane is wider than the page that will display your file, so the formatting can be …