From Local Folder to Github: S... Note

From Local Folder to Github: Setting Up my First Project With Git and Github: A Guide

Managing local files can become chaotic, with multiple versions of projects. Git Bash tracks code changes over time, while GitHub stores these changes remotely in repositories, providing backup and portfolio showcasing. To begin, install Git and configure your user name and email, then verify the installation.Next, generate an SSH key to securely connect Git to GitHub. This involves running 'ssh-keygen', accepting default locations, and optionally skipping the passphrase. Copy the generated public key.Add this public key to your GitHub account settings under SSH and GPG keys, providing a descriptive title and ensuring the key type is authentication. Test the SSH connection with 'ssh -T [email protected]' to confirm successful authentication.For your first commit, create a project folder, navigate into it, and add necessary files like a README.md and a data directory. Describe your project in the README.md file.Initialize Git in your project folder using 'git init' to start tracking changes. Use 'git status' to see untracked files, then 'git add .' to stage all changes for commit.Commit your staged changes with 'git commit -m "initial commit"', providing a clear message. Now, create a new public repository on GitHub, copying its SSH URL.Connect your local repository to the remote GitHub repository using 'git remote add origin [SSH URL]'. Finally, push your committed code to GitHub with 'git push -u origin main'.Key commands for ongoing use include 'git init' (once), 'git status' to check modifications, 'git add .' to stage changes, 'git commit -m "message"' to save, and 'git push' to upload to GitHub.