Sitemap

How To Git ‘Add Commit and Push’ using Codespaces

5 min readApr 20, 2023

--

Codespaces is a cloud-based development environment that allows developers to write, build, and debug their code online, without the need for a local development environment. It is a fully-managed service offered by GitHub and provides developers with access to a virtual machine in the cloud that is pre-configured with all the necessary tools and dependencies for their project.

Press enter or click to view image in full size

Note: This blog is a sub-part of the original blog but it can stand on its own for understanding of Git & GitHub using codespaces.

Why We Need Codespaces?

To perform changes in the original Global Azure repository we need to first clone that repository and have a coding environment on the local machine as well. That’s definitely a long and hectic way. But there is a smart and easy way, and that is Codespaces!

We will use codespaces to do all the required changes in the Global Azure repo directly without cloning it to the local machine. In this blog, you can understand how you can perform changes in any repository on GitHub and what to do after you perform those changes (Git Add, Commit & Push).

Tip: Checkout Intro To Git & GitHub Blog To Learn basic Git commands

Step To Work With Codespaces

  1. Fork Any repository
  2. Go to that forked repository
  3. Click on the Codespaces
Press enter or click to view image in full size
Codespaces

You will see all the files in that repository in the VS code that you can work on.

Press enter or click to view image in full size

4.

Right-click on the ‘template’ folder and copy it

Press enter or click to view image in full size

5.

Right-click on the ‘2023’ folder and paste the ‘template’ folder

Press enter or click to view image in full size

6.

Rename the ‘template’ folder to your community name. For example, if your community name is “yourcommunity” then the ‘template’ folder will become yourcommunity.

Note: If the community name is already taken, try to come up with some other unique name.

Press enter or click to view image in full size

7.

Right-click on the ‘yourcommunity’ folder and upload the logo of your community and delete the `template.png` file.

8.

Update the files present in the ‘yourcommunity’ folder according to the correct information. To get an idea of how to update the files, check out point 5 of the Global Azure Blog. In this case, you need to update:

Get Abdul Raheem’s stories in your inbox

Join Medium for free to get updates from this writer.

a) data.json
b) index.md

9.

Once you update the files according to the correct information, it’s time to push these changes to the original repository. Currently, these changes are visible to your VS code only, to make them visible on the GitHub repository you need to push(upload) them on the official repo.

It will include the following steps:

  • Check Status: Check the status of the file, and if there are any modified files.
Press enter or click to view image in full size
  • Add: Once you have some changes, you can stage changes in the working directory for inclusion in the next commit using “Git add .” command. It will add all the modified files.
Press enter or click to view image in full size
  • Commit: This command is used to save changes to the local repository with a descriptive message about the changes made. A commit message will be used for future reference that what these changes are doing.
Press enter or click to view image in full size
  • Push: This command is used to push all the changes from your local machine to the cloud-based repo on GitHub.
Press enter or click to view image in full size

Once you push all the changes, you can see these changes on your local GitHub repo. Remember, these changes occurred at your local repo not on the Global Azure official repo.

Press enter or click to view image in full size

10

Since all of these changes are on your local forked repo, to merge these changes with the official Global Azure repo you need to make a Pull Request.

‘Pull Request’ let the maintainer of the original repository that you have made some changes and want them to review it. Once they reviewed and merged it, you will be able to see your changes/community on the official Global Azure GitHub Repository.

How To Create A Pull Request?

a) Click On the Pull Request

Press enter or click to view image in full size

b) Click on New pull request

Press enter or click to view image in full size

c) Provide all necessary titles and descriptions and then click on Create pull request

Press enter or click to view image in full size

That’s it! Now give some time to the reviewer to review your pull request. Meanwhile, you can explore https://globalazure.net/ to know more about Global Azure!

--

--

Abdul Raheem
Abdul Raheem

Written by Abdul Raheem

Machine Learning Guy Learning 0's and 1's