/Git-Github-Resources

A complete list of all the information and resources related to Git and Github . It is useful for anyone from Beginner to a Developer .

Git and Github Resources 📚

A curated list of all git and github resources at one place.

Message

What is Git 😕

Git is the most popular version control system. It tracks changes you make to files and keeps a record of your work. It also lets you revert to earlier versions of your code if the need arises. Git drastically improves collaboration, allowing multiple people to work in sync on the same source code. Below is a selection of the most helpful and commonly used Git commands to power up your programming!

💻 Let's Install Git

Basic Git Commands

Creating a New Repository

Command Description
git init Initialize a local Git repository
git add . Add all files in the working directory to the staging area
git commit -m "<commit message>" Commit your changes
git remote add origin git@github.com:<username>/<repository-name>.git Add upstream repo to publish commits at (the remote repo)
git push -u origin master Push your changes to remote repository

⬆ Back to Top

Working on Existing Projects

Command Description
git clone ssh://git@github.com/<username>/<repository-name>.git Create a local copy of a remote repo using SSH
git clone https://github.com/<username>/<repository-name>.git Create a local copy of a remote repo using HTTPS

⬆ Back to Top

Essential Commands

Command Description
git add <file-name.txt> Add a single file to the staging area
git add -A Add all files in all directories to the staging area
git rm -r . --cached Remove all files recursively from staging area
git status See details about the current branch
git show Shows changes in committed files
git log View changes in commit history
git branch List branches (the * is the current branch)
git branch -a List all branches (local and remote)
git branch <branch name> Create a new local branch
git branch -d <branch name> Delete a local branch
git push origin --delete <branch name> Delete a remote branch
git checkout -b <branch name> Create a new local branch and switch to it
git checkout <branch name> Switch to a branch
git merge <branch name> Merge a branch into the active branch
git merge <source branch> <target branch> Merge a branch into a target branch
git push origin <branch name> Push a branch to your remote repo
git push -u origin <branch name> Push changes to remote repo (and remember the branch)
git push Push changes to remote repo (only if you have previously set a remote origin)
git push origin --delete <branch name> Delete a remote branch
git pull Synchronize local repo with remote repo
git pull origin <branch name> Pull changes from remote repo
git fetch Checks to see if there are any changes on the remote repo (does not pull changes)
git remote -v Shows URLs of remote repositories when listing your current remote connections
git remote add origin ssh://git@github.com/<username>/<repository-name>.git Add upstream repo to publish commits at (the remote repo)

⬆ Back to Top

More Git Resources

What is Github

GitHub is a web-based interface that uses Git, the open source version control software that lets multiple people make separate changes to web pages at the same time. It allows real-time collaboration and encourages teams to work together to build and edit their site content.

Github Resources

⬆ Back to Top

Thank You! 😇