Posts

Showing posts with the label Git

Setup Multiple GitHub Accounts from a Single Machine

Image
Setting up a second GitHub Account Assuming that you already a git account setup on a machine and you are looking to set up a second one to help you manage your work and personal git accounts from a single machine. You might be already aware that you git SSH key is stored in a .ssh folder under your home directory. Navigate to this directory and type "ls" to check this. cd ~/.ssh ls Next, we need to create a new SSH key using your second git email address and give it a name other than the default "id_rsa", as by this name you will already have your first git account setup. In my case, I am naming it as "id_rsa_personal" ssh-keygen -t rsa -C "automationbynishant@gmail.com" -f "id_rsa_personal" Again type "ls" and check if the new RSA public and the private key are created. ls Run eval on ssh-agent which will check if ssh-agent is running and will start it if its not already running. Next, add this new SS...

How to create a GitHub Repository

Image
Creating your first GitHub Repository Prerequisite:  You have a local project ready which you wish to push to your GitHub repo and you have git installed on your machine. Open terminal and cd to your local project directory.   cd /your-local-project-directory-path/ Initialize the project directory as a Git repository . git init Open github.com in your browser and log in with your GitHub account, if you don't have an account already, create one. Click on the "New repository" button displayed on the page. This will take you to "Create a new repository" page. Enter the name you will keep for your repository in the "Repository name" text field. You can choose to initialize your repository with a README file and also add a .gitignore file, but this is optional. Click on Create repository button and your repository will be created and you will be redirected to your repository page.  Click on "Clone or download" bu...