Skip to content

A concise guide to commonly used Git commands and workflows, perfect for beginners and those in need of a quick Git refresher.

Notifications You must be signed in to change notification settings

dizzpy/Git-Quick-Reference-Guide

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

Git Quick Reference Guide

This is a quick reference guide for beginners to Git version control. It provides step-by-step instructions on common Git commands and workflows, from initializing a repository to collaborating with others and managing project history. Whether you're new to Git or need a refresher, this guide aims to help you navigate through the essential concepts and commands efficiently

Getting Started

  1. Create a New Repository: Initialize a new Git repository for your project.

    git init
    
  2. Add Files to the Repository: Add your project files to the repository.

    git add <file(s)>
    
  3. Commit Changes with a Message: Record the changes to the repository.

    git commit -m "Initial commit"
    
  4. Connect to a Remote Repository: Link your local repository to a remote repository on GitHub (replace <repository-url> with your GitHub repository URL).

    git remote add origin <repository-url>
    
  5. Push Changes to GitHub: Upload your local commits to the remote repository on GitHub.

    git push -u origin master
    

Making Changes

  1. Add Changes to the Staging Area: Prepare changes for commit.

    git add <file(s)>
    
  2. Commit Changes with a Message: Record changes to the repository.

    git commit -m "Commit message"
    

Collaboration

  1. Push Changes to a Remote Repository: Upload local commits to a remote repository.

    git push
    
  2. Pull Changes from a Remote Repository: Fetch and merge changes from a remote repository.

    git pull
    
  3. Create a New Branch: Start working on a new feature or bug fix.

    git branch <branch-name>
    
  4. Switch to a Branch: Navigate between different branches.

    git checkout <branch-name>
    
  5. Merge Changes from Another Branch: Combine changes from one branch into another.

    git merge <branch-name>
    

Miscellaneous

  1. Check Repository Status: View the status of tracked and untracked files.

    git status
    
  2. View Commit History: See a log of commits.

    git log
    
  3. List Remote Repositories: Display configured remote repositories.

    git remote -v
    
  4. Fetch Objects and References from Another Repository: Download objects and refs from another repository.

    git fetch
    
  5. List, Create, or Delete Tags: Manage tags for marking important points in history.

    git tag
    

With these basic Git commands, you can efficiently manage your version-controlled projects and collaborate with others. Feel free to explore more advanced Git features as you become more comfortable with the basics.

Dizzpy | Happy coding! 🖥️🥰

About

A concise guide to commonly used Git commands and workflows, perfect for beginners and those in need of a quick Git refresher.

Topics

Resources

Stars

Watchers

Forks

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy