Hello and welcome to the world of version control! In our #90DaysOfDevOps Series, today, we'll be discussing about Git and its companion, GitHub, empowering you to manage your code efficiently. Get ready to unlock a new level of collaboration and organization.
1. Create a Github Account:
Head over to https://github.com/ and click "Sign up".
Follow the prompts, enter your details, and create a strong password. You're now a proud member of the GitHub community!
2. Set up a Git Repository:
Download and install Git: Go to https://git-scm.com/downloads and download the appropriate version for your operating system. In my case, I'm running Ubuntu. So I'll be using below commands to install Git
Open a terminal: On Windows, use Command Prompt; on Mac/Linux, use Terminal.
Create a new directory for your project: Navigate to your desired location and use the command mkdir <project_name> to create a new directory for your project.
Initialize Git: Inside your project directory, type git init to create a new Git repository.
3. Exploring Github:
Now comes the fun part!
Create a new repository: Go to https://github.com/ and click the "New repository" button. Enter a name and description for your repository, choose the visibility (public or private), and click "Create repository".
Connect your local repository: In your terminal, navigate to your project directory and type git remote add origin https://github.com/<your_username>/<repository_name>.git to connect it to your newly created repository on GitHub.
Add files to your repository: Use the command git add <filename> to add individual files or git add . to add all files in your project directory to the staging area.
Commit your changes: Once you're happy with the changes, type git commit -m "commit message" to commit them to your local repository.
Push your changes to Github: Finally, type git push -u origin master to push your local commits to your remote repository on GitHub.
Bonus Commands:
View the status of your Git repository: git status
List all tracked files: git ls-files
View the history of your commits: git log
Undo your last commit: git reset HEAD~1
Explore the depths of Github:
Browse other repositories: Search for projects that interest you and learn from other developers.
Contribute to existing projects: Fork a repository, create your own branch, make your changes, and submit a pull request to contribute to the project.
Collaborate with others: Team up with other developers to work on projects together.
Remember this is just the tip of the iceberg! As you delve deeper into Git and GitHub, you'll discover powerful features and workflows that will enhance your development experience.
Resources for further exploration:
Git documentation: https://git-scm.com/doc
GitHub tutorials: https://github.com/git-guides
Interactive Git learning: https://learngitbranching.js.org/
Start exploring, experiment, and unleash the power of Git and GitHub!
Thank you for reading!
*** Explore | Share | Grow ***
Comments