All Projects β†’ GoldinGuy β†’ UltimateGitResource

GoldinGuy / UltimateGitResource

Licence: other
πŸ“š The ultimate collection of git commands and resources to power up your programming!

Projects that are alternatives of or similar to UltimateGitResource

cheat-sheet
collection of cheat sheets
Stars: ✭ 150 (-61.34%)
Mutual labels:  git-cheatsheet, cheat-sheet
Qiubaiying.github.io
BY Blog ->
Stars: ✭ 2,674 (+589.18%)
Mutual labels:  github-pages
Ghpages
Deploy arbitrary static assets through GitHub Actions
Stars: ✭ 169 (-56.44%)
Mutual labels:  github-pages
Mm Github Pages Starter
Minimal Mistakes GitHub Pages site starter
Stars: ✭ 191 (-50.77%)
Mutual labels:  github-pages
Oscailte
Oscailte β€” A powerful light, clean, and responsive Jekyll theme.
Stars: ✭ 178 (-54.12%)
Mutual labels:  github-pages
Slate
Slate is a Jekyll theme for GitHub Pages
Stars: ✭ 195 (-49.74%)
Mutual labels:  github-pages
Awesome Github
A curated list of awesome GitHub guides, articles, sites, tools, projects and resources. 攢集这δΈͺεˆ—θ‘¨οΌŒεͺζ˜―δΈΊδΊ†ζ›΄ε₯½εœ°δ½Ώη”¨GitHub,欒迎提亀prε’Œissue。
Stars: ✭ 1,962 (+405.67%)
Mutual labels:  github-pages
Awesome-CyberSec-Resources
An awesome collection of curated Cyber Security resources(Books, Tutorials, Blogs, Podcasts, ...)
Stars: ✭ 273 (-29.64%)
Mutual labels:  resource
Millennial
A minimalist Jekyll theme for running an online publication
Stars: ✭ 223 (-42.53%)
Mutual labels:  github-pages
Jekyll Remote Theme
Jekyll plugin for building Jekyll sites with any GitHub-hosted theme
Stars: ✭ 188 (-51.55%)
Mutual labels:  github-pages
Gportfolio
Creating an automatic portfolio based on Github profile, with the ability to connect others
Stars: ✭ 186 (-52.06%)
Mutual labels:  github-pages
Blog
a blog demo on github pages
Stars: ✭ 179 (-53.87%)
Mutual labels:  github-pages
Fastpages
An easy to use blogging platform, with enhanced support for Jupyter Notebooks.
Stars: ✭ 2,888 (+644.33%)
Mutual labels:  github-pages
Godot Ci
Docker image to export Godot Engine games. Templates for Gitlab CI and GitHub Actions to deploy to GitLab Pages/GitHub Pages/Itch.io.
Stars: ✭ 168 (-56.7%)
Mutual labels:  github-pages
Emacs Easy Hugo
Emacs major mode for managing hugo
Stars: ✭ 235 (-39.43%)
Mutual labels:  github-pages
Spotify Github Profile
Show your Spotify playing on your Github profile
Stars: ✭ 159 (-59.02%)
Mutual labels:  github-pages
Fast template
A template for really easy blogging with GitHub Pages
Stars: ✭ 184 (-52.58%)
Mutual labels:  github-pages
Nsacyber.github.io
NSA Cybersecurity. Formerly known as NSA Information Assurance and the Information Assurance Directorate
Stars: ✭ 193 (-50.26%)
Mutual labels:  github-pages
kakaoenterprise.github.io
Kakao Enterprise AI Research
Stars: ✭ 18 (-95.36%)
Mutual labels:  github-pages
Just The Docs
A modern, high customizable, responsive Jekyll theme for documention with built-in search.
Stars: ✭ 3,747 (+865.72%)
Mutual labels:  github-pages

UltimateGitResource

πŸ“š A list of helpful Git commands for the Google DSC Git Event & Hackapalooza Hackathon

Discuss On Discord Contributors Issues

Watch a recording of the All About Git presentation here!

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!

Note - Wherever used the shorthand Repo means Repository

The Docs folder of this repo contains a simple profile/resume static site built on HTML5 and TailwindCSS to help learn about Github pages. You can clone the repository and test it out yourself, or visit this link to see a live demo. For more info look at the README for the /docs directory.

This repo contains a powerpoint presentation explaning many of these commands that can be viewed online here.

Table of Contents

Git Commands

You can run git help in the terminal to learn about many of these commands at any time. git help -a and git help -g list available subcommands and concept guides. git help <command> or git help <concept> allow you to read about a specific subcommand or concept.

HEAD represents your current working directory. The HEAD pointer can be moved to different branches, tags, or commits using git checkout.

The gitignore file allows you to control what gets committed and what doesn't, allowing you to keep your keys and passwords secure, and reducing the amount of bloat on the remote repo. You can learn more about it in the .gitignore file above.

πŸ“— Gitting Existing Projects

Command Description
git clone ssh://[email protected]/<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

You can also fork repos (create a copy of the original repo that remains on your GitHub account).

πŸ“˜ Gitting Started - Setting Up a New Repo

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 [email protected]:<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

More Options For Staging Files

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 <file-name.txt> Remove a single file (or folder)
git rm -r . --cached Remove all files recursively from staging area

πŸ“™ The Nitty Gitty - Examine History & State

Command Description
git status See details about the current branch
git show Shows changes in committed files
git log View changes in commit history
git log --summary View changes (detailed)
git log --oneline View changes (briefly)
git diff <source branch> <target branch> Preview changes before merging

πŸ“’ Branching Out - Grow, Mark & Tweak History

Command Description
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 -b <branch name> origin/<branch name> Clone a remote branch and switch to it
git branch -m <old branch name> <new branch name> Rename a local branch
git checkout <branch name> Switch to a branch
git checkout - Switch to the most recent branch
git checkout -- <file-name.txt> Revert your recent changes to a file

πŸ“• Git Gud - Dealing With Merge Conflicts

Command Description
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 merge --abort Abort the current conflict resolution process, and attempt to reconstruct the pre-merge state
git stash Stash changes in a dirty working directory
git stash clear Remove all stashed entries

πŸ““ Git More - Pushing, Pulling, & Remote Origin

Command Description
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 fetch --prune Fetch all remote branch refs and delete those no longer in use
git remote -v Shows URLs of remote repositories when listing your current remote connections
git remote add origin ssh://[email protected]/<username>/<repository-name>.git Add upstream repo to publish commits at (the remote repo)
git remote set-url origin ssh://[email protected]/<username>/<repository-name>.git Set a repo's origin branch to SSH

πŸ“” Gitting Complicated - The Danger Zone

HEY! Changing your history may cause undesired side effects. You may lose data. Many of these commands cannot be undone. If you change your remote history, don't say I didn't warn you.

Command Description
git rebase <branch> Reapply commits on top of another base tip
git rebase -i <commitID> Reapply all commits from <commitID forward
git cherry-pick <commitID> Apply the changes introduced by some existing commits
git clean -f Removes and deletes untracked files from the working tree
git clean -fd Remove all untracked directories
git commit --amend Allows you to edit a previous commit that has not been pushed
git commit --fixup <commitID> Combine new changes with an existing commit under the same name
git reset <commitID> Reverts all commits after specified commit, while keeping local changes
git reset --hard <commitID> Reverts all history and changes back to the given commit
git reset HEAD~1 Revert 1 commit (while keeping current local state)
git push origin <branch> --force Deletes all your previous commits and pushes your current one

πŸ“– More Git Resources

Contributing

  1. Fork UltimateGitResource here
  2. Create a branch with your improvements (git checkout -b improvement/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin improvement/fooBar)
  5. Create a new Pull Request

Meta

Created by @GoldinGuy for the FAU Google DSC Git Event.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].