The Journey Begins
Like every journey, we need a trail, a compass, a couple of checkpoints and milestones, and a general sense of direction, and we need to know how to weave all these elements to move from the start to the destination. My journey is much the same, from a folder on my desktop to a repository on my GitHub. Join me.
Tools used
- GitHub
- Git Bash
- Windows PowerShell
- File explorer
- Excel
- VS Code
Workflow
A general overview of the checkpoints on our journey
- Create a folder
- Create a GitHub account
- Create an SSH key
- Start the SSH agent and add your key
- Add the key to GitHub
- Create a repository on GitHub
- Link your folder
Creating a folder
To get to this checkpoint, I have 2 alternative paths that we can use. The general sense of direction arriving at a new folder created in a path of your choice.
Using file explorer
Navigate to the desired location via the file explorer and create a new folder.
Using Git Bash
- On Git Bash, use the cd command and a path to navigate to the desired location.
- Use the
mkdircommand to create a folder in that location.
Creating required files and subfolders
Inside your main folder, you can create files and folders that you will need for your project.
- You may need to create a README file to document the description pf your project. For example what you're trying to achieve and the tools used in the project. Use the
touchcommand for this.
- To create a subfolder, use the
mkdircommand while inside the main folder.
Creating a GitHub Account
Navigate to the GitHub website. You have the option of signing up with email or you can continue with Google.
Creating an SSH Key
Your SSH key authenticates you to GitHub to ensure that you are the only one allowed to make pushes, clone, fetch, etc.
- Open PowerShell and run as administrator. Check the version of Git installed or install if necessary.
- Open Git Bash and generate SSH key and SSH passphrase. Use the command
ssh-keygen -t ed25519 -C "your_email@example.com" - On running the command, set a location to store it or accept the default if it is your first key, and the set a passphrase.
Adding the SSH Key to the SSH Client
- Run Windows PowerShell as administrator.
- Run
Get-Service -Name ssh-agent | Set-Service -StartupType Manual - Then
Start-Service ssh-agent\to start the agent. - Close the administrator PowerShell and open a normal PowerShell window.
- Run the command
ssh-add c:/Users/YOUR_USERNAME/.ssh/id_ed25519. ReplaceYOUR_USERNAMEwith your actual Windows username.
To finalize adding your SSH key to your GitHub
- Copy the public key by running below command on Git Bash
cat ~/.ssh/id_ed25519.pub | clip - Or display it by running
cat ~/.ssh/id_ed25519.puband then manually copy it.
Adding the SSH Key to GitHub
- Navigate to New SSH Key or Add SSH Key on your GitHub profile.
- In the SSH Key form, give it a title, set the Key type to Authentication Key and paste the key copied above, and click Add SSH Key
Creating a Repository on GitHub
- Log into GitHub and click on **Add New Repository **
- Fill in the name, description, and set it to either public or private
- Create repository
- Copy the SSH URL. This will be used to connect your local folder.
Linking Local Folder to GitHub
Using Git Bash
- Navigate to the project folder using cd command (main folder).
- Run
git initto initialize Git. This means that GitHub will be tracking the changes in the folder. - Run
git remote add origin [SSH_URL]to connect the local folder to the Git repository. The SSH URL is the link to the repository created in GitHub. - Run
git add .to stage. The dot indicates that staging should be done in the specific directory we're in. - Run
git commit -m[commit message]to set your commit message. - Run
git branch -M mainto rename the current branch as main. - Run
git push -u origin mainto push to GitHub.
Conclusion
There are different methods to achieve the same thing for different hurdles, much like taking different routes between successive check points. The important thing is to consider what you want to achieve, the tools to use, and the commands to run.

Top comments (0)