Setup SSH keys | Setup Repo in GitHub and Setup Java Project in GitHub | Add a project in GitHub
How to setup SSH keys | How to setup Repo in GitHub and Setup Java Project in GitHub | How to add a project in GitHub #repo #git #githup #ssh #key #ubuntu How to setup SSH keys | How to setup Repo in GitHub and Setup Java Project in GitHub | How to add a project in GitHub Pre-requistes: 1. GitHub account 2. Git client installed 3. Ubuntu OS Git Installation apt update apt install git -y git --version git config --global user.name "Tekno Pathshala" git config --global user.email "admin@teknopathshala.com" Step # 1 - Create private repository in GitHub.com Go to https://github.com/ Click on New to create a new repo Also choose initialize with repository with a README option. Step # 2 Create SSH keys from your source machine Type ssh-keygen (and then simply enter four times, do not give any password). ssh-keygen will generate two keys - public keys and private keys. We need to upload the public keys into GitHub copy the content of public key by executing below command in Git bash: sudo cat ~/.ssh/id_rsa.pub ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDGf/JdMvcDjPFf82Zj5nfFg4CXFm7qHEogZiZ7w1ngG6QbWJzH0VafTgRMz7vyZB1N10a1ib14VVT2pC2IdISprwVnF1O4Ddga7puzr+SSrmw2JRD55XF8UBIiLxUBFd8LWbFnC+YUgVAMNoanSG09dGRZvLPQM1dqwqIgA14ZRLap4nNLe0syBiN1C1+iCUXbC3zPmF/PRzcoI4N6YuF3XAgQA2GlJ8cTrxcr1hfjHJYhGI5KLrNAFTvYfg1u+bCkTzvNiDjeQyw56mstsDTxBTJkJjNSjP+tu5iRp9ETLaRbETmisKCa3Kxm75d2Yg57sk3k/E87mgJhq8okSIJTIkh+j9AIj5K+B6TdwnsF8fQy5ojssUZEtrCCsHOuz2GBwlZ+lb2ERjAI0e66eJAMtuj4JcvKJ82JVG8GlZ2y+joXBCOGTdnpovppQzMMH7ts7V3MaX//n9mp2iHuIAl8/YPu2yK6NedgMYbRF9umfG6mkyOzjr+RDXMqu+Duefk= root@nagios Step # 3 - Upload SSH Keys in GitHub Copy SSH keys Key section and then click on Add SSH key. Step # 4 - Clone Repo locally git clone git@github.com:TeknoPathshala/MyAppRepo.git type below command to list the directory ls –al Now go into repo folder you have cloned. cd MyAppRepo Step # 5 - Create Java Web App using Maven Install Maven first apt install maven Use below maven command to create Java Web App using Maven. mvn archetype:generate -DgroupId=com.dept.app -DartifactId=MyWebApp -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false Step # 6 - Push Java Web App using Git commands into GitHub Check Git Status git status Now add the newly created folder by executing below command: git add * Now make sure all the files are moved to staging area, when you execute below command: git status Perform below command to commit the changes to local repository first. git commit -m "my first java project push to GitHub" Now perform below command to push from local repository to remote repository. git push Verify code changes in GitHub Now to GitHub and click on the repo, you will see your commits.
How to setup SSH keys | How to setup Repo in GitHub and Setup Java Project in GitHub | How to add a project in GitHub #repo #git #githup #ssh #key #ubuntu How to setup SSH keys | How to setup Repo in GitHub and Setup Java Project in GitHub | How to add a project in GitHub Pre-requistes: 1. GitHub account 2. Git client installed 3. Ubuntu OS Git Installation apt update apt install git -y git --version git config --global user.name "Tekno Pathshala" git config --global user.email "admin@teknopathshala.com" Step # 1 - Create private repository in GitHub.com Go to https://github.com/ Click on New to create a new repo Also choose initialize with repository with a README option. Step # 2 Create SSH keys from your source machine Type ssh-keygen (and then simply enter four times, do not give any password). ssh-keygen will generate two keys - public keys and private keys. We need to upload the public keys into GitHub copy the content of public key by executing below command in Git bash: sudo cat ~/.ssh/id_rsa.pub ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDGf/JdMvcDjPFf82Zj5nfFg4CXFm7qHEogZiZ7w1ngG6QbWJzH0VafTgRMz7vyZB1N10a1ib14VVT2pC2IdISprwVnF1O4Ddga7puzr+SSrmw2JRD55XF8UBIiLxUBFd8LWbFnC+YUgVAMNoanSG09dGRZvLPQM1dqwqIgA14ZRLap4nNLe0syBiN1C1+iCUXbC3zPmF/PRzcoI4N6YuF3XAgQA2GlJ8cTrxcr1hfjHJYhGI5KLrNAFTvYfg1u+bCkTzvNiDjeQyw56mstsDTxBTJkJjNSjP+tu5iRp9ETLaRbETmisKCa3Kxm75d2Yg57sk3k/E87mgJhq8okSIJTIkh+j9AIj5K+B6TdwnsF8fQy5ojssUZEtrCCsHOuz2GBwlZ+lb2ERjAI0e66eJAMtuj4JcvKJ82JVG8GlZ2y+joXBCOGTdnpovppQzMMH7ts7V3MaX//n9mp2iHuIAl8/YPu2yK6NedgMYbRF9umfG6mkyOzjr+RDXMqu+Duefk= root@nagios Step # 3 - Upload SSH Keys in GitHub Copy SSH keys Key section and then click on Add SSH key. Step # 4 - Clone Repo locally git clone git@github.com:TeknoPathshala/MyAppRepo.git type below command to list the directory ls –al Now go into repo folder you have cloned. cd MyAppRepo Step # 5 - Create Java Web App using Maven Install Maven first apt install maven Use below maven command to create Java Web App using Maven. mvn archetype:generate -DgroupId=com.dept.app -DartifactId=MyWebApp -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false Step # 6 - Push Java Web App using Git commands into GitHub Check Git Status git status Now add the newly created folder by executing below command: git add * Now make sure all the files are moved to staging area, when you execute below command: git status Perform below command to commit the changes to local repository first. git commit -m "my first java project push to GitHub" Now perform below command to push from local repository to remote repository. git push Verify code changes in GitHub Now to GitHub and click on the repo, you will see your commits.