Skip to content Skip to sidebar Skip to footer

How to Upload From Cloud9 to Github

[three] Integrate AWS Cloud9 with GitHub

When you work on a project, it is very probable that you will want to store the files generated in your Cloud9 development environment to some common repository exterior this EC2 VM. Ane reason is so that you don't lose your code if anything happens to this VM on AWS

Otherwise also, there might exist many developers working on the same projection and each of them may desire to add together or make changes to files and store them exterior of their environment into some common place.

This is where GitHub.com comes in. It is where nearly of today's open up-source projects are developed.

In this blogpost, we will look at integrating your development environment in social club to get the power to sync your work to a remote location where it is integrated with work done by others

Step-1: Sign-in to your GitHub account

Step-2: Create a new repository on GitHub

2.i: Click on New repository option in top correct-manus corner dropdown menu on GitHub website

ii.2: Enter Name of repository, Select it as Public and Don't forget to click check box "Initialize this repository with a README" as shown above and and so click Create Repository push

2.iii: You should meet landing folio showing the repository created along with a README.md file

Step-3: Update/Upgrade your Cloud9 environment

three.one: Open your Cloud9 IDE, correct-click on root binder (C9.NodeJS in my case) and select selection Open Concluding Here from the menu

3.ii: In the open concluding window, blazon the post-obit commands

  • sudo apt update
  • sudo apt upgrade
  • sudo apt autoremove

if at anytime during executing above command, if you lot get a prompt request Practise you lot want to go on (Y/northward), please type Y and Enter.

This will aid bring your EC2 instance hosting your Cloud9 IDE and running on Ubuntu Os to latest patches.

Step-4: Install Git in your Cloud9 environment

4.1: Right-click on root binder and create a new folder under it called "repository"

4.two: On your terminal windows, navigate to this repository binder

cd repository

iv.3: Check if git is installed

git –version

iv.4 Set your Git UserName and EmailAddress past running below commands

git config –global user.name "AshKamdar"

git config –global user.electronic mail "ash.tsys@gmail.com"

If there is nothing shown on last and cursor moves to next line, it means, control executed successfully.

Step-5: Clone remote GitHub repository in your environment

5.one: Visit your GitHub repository page, click small downward pointer on correct side of dark-green button named "Clone or download".

five.2: Click "User HTTPS" link to get URL of your git repository in https format

Copy this URL into clipboard

five.3: Now become back to terminal window in your Cloud9 IDE and run post-obit command

git clone https://github.com/AshKamdar/AdventuresInCloud.git

Make sure to put Your git URL which you copied in above command

5.4: Congratulations. You lot have successfully cloned your remote GitHub repository into your Cloud9 environment.

Besides, if you refresh your repository folder, you can run across it at present has contents that were present in our GitHub repository.

Step-6: Adding files to local repository and pushing them to GitHub

6.ane: Right-click on AdventuresInCloud folder and click New File and create a file named testing.txt

half-dozen.2: Open the file by double-clicking it and scribble some text in it

half dozen.3: Run the following iii commands. Beginning to articulate previous contents, second to motion into repository binder and third to meet whether git recognized our newly created file "testing.txt"

clear

cd AdventuresInCloud

git status

As you tin can see, git has identified creation of new file locally.

6.four: Add file testing.txt to git staging area by running post-obit command

git add –all

6.5: Commit staged files to local git repository

git commit -m "Added a new file named testing.txt in Cloud9 IDE."

This means the file is now part of local git repository and it has started tracking (version controlling) it.

6.6: At present nosotros want to push this file to GitHub, so it is no longer just in this machine but is added to our mutual repository binder on GitHub, where presumably other developers are also adding their files from their ain development environments

git push button

You lot will be prompted to enter your username/password and after that, Git will piece of work to sync contents of your local git repo with the ane on GitHub website

half-dozen.7: You can verify that the file is pushed by visiting the GitHub website

Step-7: Pull newly added file(s) from GitHub to local surroundings

You can exercise this exercise equally do.

7.1 Add a new file in GitHub website in our repository "AdventuresInCloud"

7.ii Come back to our Cloud9 surround and execute the control

git pull

You lot will meet that the file is being Pulled from GitHub to your local environment

Conclusion

So this style, we tin integrate our Cloud9 environment with GitHub to store all our source code in a global repository.

Happy Clouding!

campisiefiraboys.blogspot.com

Source: https://medium.com/@AshKamdar/3-integrate-aws-cloud9-with-github-a1982e05844f

Post a Comment for "How to Upload From Cloud9 to Github"