The objective of this assignment was to familiarize with the basic workflow of creating a GitHub repository, connecting it to a local folder, and making commits and pushes.
- A GitHub account
- Git installed on the local machine
- A code editor (e.g., Visual Studio Code, Sublime Text)
- GitHub Repository Creation:
- Logged in to GitHub account.
- Created a new repository named "PLPBasicGitAssignment".
- Initialized the repository with a README file.
-
Local Folder Setup:
- Created a new folder named "PLPBasicGitAssignment" on the local machine.
-
Git Initialization:
- Opened a terminal.
- Navigated to the "PLPBasicGitAssignment" folder.
- Initialized a new Git repository using the command
git init
.
-
Connecting to GitHub:
- Linked the local repository to the GitHub repository using the command:
git remote add origin <repository-url>
- Linked the local repository to the GitHub repository using the command:
-
Create a File:
- Created a new text file named
hello.txt
inside the "PLPBasicGitAssignment" folder. - Added a simple text message "Hello, Git!" to the
hello.txt
file.
- Created a new text file named
-
Committing Changes:
- Staged the changes using the command:
git add hello.txt
- Committed the changes with the message "Add hello.txt with a greeting" using the command:
git commit -m "Add hello.txt with a greeting"
- Staged the changes using the command:
- Pushing to GitHub:
- Pushed the committed changes to the GitHub repository using the command:
git push -u origin main
- Pushed the committed changes to the GitHub repository using the command:
- Verify on GitHub:
- Visited the GitHub repository in a web browser.
- Confirmed that the
hello.txt
file and commit message are visible.
- This is my documentetion of all steps and commands used in this assignment for future reference.