<aside> ℹ️
Git is a version control system that allows developers to collaborate on projects and keep track of changes. GitHub is a hosting platform for version control and collaboration on projects.
</aside>
echo "<Text>" >> README.md # create your first file in the repo
git init
git add README.md
git commit -m "<commit message>"
git branch -M main
git remote add origin <repo_url>
git push -u origin main
git remote add origin >repo_url>
git branch -M main
git push -u origin main
Git has many commands available to help you manage your projects. Some of the most common commands are:
git init
: Creates an empty Git repository in the current foldergit clone <url>
: Clones a remote repository to your computergit add <file>
: Adds a file to the staging areagit commit -m "<message>"
: Commits the changes to the repository with a messagegit push
: Pushes the changes to a remote repositorygit pull
: Pulls changes from a remote repositoryBranches are used to work on different versions of a project simultaneously. You can create, delete, and merge branches as needed. Common branch commands include:
git branch <name>
: Creates a new branch with the given name