How to Push an AEM Project to GitHub for the First Time

GitHub repository is a storage place where your project’s files, code, and version history are managed using Git. It allows multiple developers to collaborate, track changes, and maintain different versions of a project.

A GitHub repo can be public (accessible to everyone) or private (only visible to selected users). It typically contains:

  • Source code files
  • Commit history
  • Branches for different versions
  • Issues and pull requests for collaboration

We have already created blogs for GitHub account creation and AEM Project creation.

Log into your GitHub account. To create a repository for the first time, you have two options: Click on the Create repository button or click on the + button and select the New repository option.

→ After selecting the New repository option, the following screen will appear, where you need to provide some details.

  • Provide the Repository Name.
  • The Description is optional.
  • Select the Repository Type (public or private).
  • After providing all the details, click on the Create repository button.

→ Our first GitHub repository has been created.

→ Open Repository, where you can find the protocols (HTTP & SSH) and some commands for creating a new repository and pushing code to an existing repository via the command line.

→ In GitHub, HTTP and SSH are the protocols used to clone, fetch, and push repositories.

1. HTTP (HyperText Transfer Protocol)
  • Uses URLs like https://github.com/TechStackPulse/tech-stack-pulse.git

  • Requires you to enter your GitHub username and personal access token every time you push or pull (unless cached)

  • Easier to set up, especially for beginners

  • SSH may be prohibited on some networks, yet HTTP works.

2. SSH (Secure Shell Protocol)
  • Uses URLs like git@github.com:TechStackPulse/tech-stack-pulse.git

  • Requires you to set up an SSH key on your local machine and link it to GitHub

  • More secure and convenient (no need to enter credentials every time)

  • Faster, especially for large repositories

→ We will clone the repository locally using the HTTP protocol. Copy the HTTP URL to clone the repository to your local system.

→ Open the command prompt in your desired location. In my case, I created a new folder named “GitHub,” where I will clone my project.

 

→ Copy the HTTP protocol URL for the cloning and use the git clone command.

Command: git clone {HTTP protocol URL} –> git clone https://github.com/TechStackPulse/tech-stack-pulse.git

→ Before cloning my GitHub folder.

→ After cloning my github folder:

→ After cloning, we must add the public key in our local for authentication purposes, and this is only a one-time activity. Open the settings page.

→ Navigate to Tokens creation page, Settings > Developer Settings > Personal access tokens > Token (classic), click on the Generate new token button and select the Generate new token (classic) option.

→ Here, you must provide the Note, Token Expiration Date, and Scope of the Token. After click on the Generate Token button.

 

→ Copy the Personal Access Token and paste it into Notepad ++ or somewhere.

→ Open the Command Prompt (CMD) to configure your Access token on your machine.

Command:

git remote set-url origin https://ghp_5UDw2bKpIcV8g8usZOykRqjghhghgfhgvNWaF2pFzKL@github.com/TechStackPulse/tech-stack-pulse.git

 

→ Check the git status.

git status

 

→ Now, we can move all our project-related modules into the local GitHub repository folder. E:\Tsp\tech-stack-pulse to E:\Tsp\github\tech-stack-pulse

 

→ Again, we can check the git status.

→ Now, we can easily stage all our files by using the following command.

The below command is used to stage all changes (new, modified, and deleted files) in the current repository for the next commit.

Adding all files at a time:

git add . 

Adding file by file at a time:

git add filename.extenstion 

→ Now, we can commit our changes.

 git commit -m "Initially commit" 

→Finally, after completing all the necessary steps, we can now push our changes from the local repository to the GitHub repository. By using the fallowing command.

git push

 

Our GitHub Repository URL:  https://github.com/TechStackPulse/tech-stack-pulse

Thank you for visiting our site! We’d love to hear your thoughts—feel free to leave a comment below.

                                                                          😊😊😊

 

1 thought on “How to Push an AEM Project to GitHub for the First Time”

Leave a Comment