Skip to content

Why use Github? I am new and have no idea! #118853

Discussion options

You must be logged in to vote

Working with GitHub

GitHub is essential for version control and collaboration. Here’s how you can add, commit, and push changes to your repository:

Git Commands

1. Add

  • Purpose: Prepares changes for the next commit by adding them to the staging area.
  • Command:
    • To add a specific file:
      git add <file-name>
    • To add all modified files:
      git add .

2. Commit

  • Purpose: Saves the staged changes to the local repository. Each commit has an associated message, which is a description explaining why a particular change was made.
  • Command:
    git commit -m "Your commit message"
    git push origin <branch-name>

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ettaboyle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants