Sat. Feb 4th, 2023

Category: Git

Git Synchronize changes

Synchronize your local repository with the remote repository on GitHub.com $ git fetch Downloads all history from the remote tracking branches $ git merge Combines remote tracking branches into current…

Git Redo commits

Erase mistakes and craft replacement history $ git reset [commit] Undoes all commits after [commit], preserving changes locally $ git reset --hard [commit] Discards all history and changes back to the…

Git Make changes

Browse and inspect the evolution of project files $ git log Lists version history for the current branch $ git log --follow [file] Lists version history for a file, beyond…

The .gitignore file

Sometimes it may be a good idea to exclude files from being tracked with Git. This is typically done in a special file named .gitignore.

Git Branches

Branches are an important part of working with Git. Any commits you make will be made on the branch you’re currently “checked out” to. Use git status to see which branch that…

Git Create repositories

A new repository can either be created locally, or an existing repository can be cloned. When a repository was initialized locally, you have to push it to GitHub afterwards. $…

Git Configure tooling

Configure user information for all local repositories $ git config --global user.name "[name]" Sets the name you want attached to your commit transactions $ git config --global user.email "[email address]"…