Bare minimum Git Bash

taken meme - I will find you and i will git blame you

The purpose of this guide is to serve as a reference for basic functions that you can do using Git that you will need as a developer on a team.

You can install Git here (it will come with Git Bash): https://git-scm.com/downloads

Git has an awesome 15-minute tutorial here: https://try.github.io/levels/1/challenges/1

Clone down a project
git clone <project URL>

// Example
git clone https://github.com/viktordd/BetrayalCharacterStats.git

Commit, check for new changes from repo, then push your committed changes
// Stage and commit your changes
git add .
git commit -m "add comments here for your changeset"

// Check for changes in server
git fetch

// Pull changes from server, may need to resolve merge conflicts at this point
git pull

// Push your committed changes to server
git push 


Create a new branch and swap to the new branch
git checkout -b <branchname>

// Example
git checkout -b WI123-build-mobile-QR-scanner


Swap branches
git checkout <branchname>

// Example
git checkout WI123-build-mobile-QR-scanner
git checkout develop


Push a local project to an empty repo
git init
git add .
git commit -m "initial project"

// Substitute URL with your GitHub, VSTS, BitBucket, or other URL
git remote add origin https://yourURL.visualstudio.com/GitDemo1/_git/ASDF
git push -u origin --all

Comments

Post a Comment

Popular posts from this blog

Electron JS, Visual Studio Code, and SQL Operations Studio

Unity vs. Unreal Engine

Free & Paid Resources for Getting Started in IT