Skip to content

Moksh45/MPC-learning-git-juet-2023

Repository files navigation

Git commands for New user:

  1. Initialize a New Git Repository: Start tracking changes in a new or existing project.

    git init
  2. Clone a Repository: Create a copy of a remote repository on your local machine.

    git clone <repository_url>
  3. Check the Status: View the status of your current repository, showing changes that need to be committed.

    git status
  4. Add Changes: Stage changes for commit.

    git add <file_name>      # Stage a specific file
    git add .               # Stage all changes
  5. Configure Git: Set your name and email for Git commits.

    git config --global user.name "Your Name"
    git config --global user.email "[email protected]"
  6. Commit Changes: Create a snapshot of the staged changes.

    git commit -m "Your commit message"
  7. Add Remote Repository as "Origin": Associate a remote repository with the name "origin" in your local repository.

    git remote add origin <repository_url>
  8. Push to Remote: Upload your local changes to a remote repository.

    git push origin <branch_name>
  9. View Commit History: See a list of all commits in the current branch.

    git log
  10. Create a New Branch: Start a new branch to work on a feature or bug fix.

    git branch <branch_name>
  11. Switch Branches: Move between branches.

    git checkout <branch_name>
  12. Pull from Remote: Fetch changes from a remote repository and merge them into your current branch.

    git pull origin <branch_name>
  13. Check Remote Repositories: List remote repositories associated with your project.

    git remote -v

About

A Git tutorial Repository.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published