Git Github Intro
Git Github Intro
● Step 2: Initialize a new Git repository with the command git init:
● Step 3: Commit the changes with the command: git commit -m "Your commit
message"
You can see your message by going into the gitdemo folder, into .git, and looking at
the COMMIT_EDITMSG file:
Branches
● Step 1: Create a new branch with the command:
Creating a GitHub repository enables you to host your code online and collaborate
with others. Once you have created a repository, you can add files to it, make
changes, and collaborate with others by sharing the repository's URL. You can also
add collaborators to your repository to enable them to work on the project with you.
Connecting to a Github Repository
● Step 1: Go to your GitHub repository page and locate the HTTPS URL for the
repository.
● Step 2: Copy the repository's HTTPS URL to your clipboard.
● Step 3: Open your terminal and navigate to your local repository.
● Step 4: Add the remote repository with the command: git remote add origin
repositoryurl. Authenticate via the browser.
Pushing and pulling changes
● To push a local change to GitHub, use the command: git push origin branch-
name
● To pull changes from GitHub to your local repository, use the command: git
pull origin branch-name