Spartronics4915
  • Introduction
  • Version Control and Git
    • Introducing Git and GitHub
    • Git Fundamentals
    • Next Level Git
    • Git Flow
    • FAQ: git, vi, bash shell
    • A Simple Tutorial
  • An Introduction to Java
    • Lesson 1: Introductory Syntax
    • Lesson 2: Variables and Datatypes
    • Lesson 3: Method Calls
    • Lesson 4: The If Statement
    • Lesson 5: Method Definitions
    • Lesson 6: Classes
    • Lesson 7: Inheritance
    • Helpful Programming Resources
  • Programming a Robot
    • Pre-Lesson: What is a Robot?
    • Setting up your Development Environment
    • Lesson 1: Motors and the Interative Robot
    • Lesson 2: What is a Subsystem?
    • Lesson 3: What are Commands?
    • Lesson 4: What are Command Groups?
    • Lesson 5: Scheduling Commands
  • Data Analysis
  • Arduino and Bling Development
    • Setup Arduino IDE
    • Starting with Bling
    • Spartronics Clock with NeoMatrix
    • Related Tutorials and Resources
Powered by GitBook
On this page
  • Staging and Committing Code
  • Dealing with Merge Conflicts
  • Opening Pull Requests

Was this helpful?

  1. Version Control and Git

A Simple Tutorial

PreviousFAQ: git, vi, bash shellNextAn Introduction to Java

Last updated 4 years ago

Was this helpful?

The goal of this tutorial is to give students hands-on experience in dealing with three of the most common aspects of Git - writing, staging and committing code, resolving merge conflicts, and opening pull requests.

Staging and Committing Code

  1. Create a of our to your account on GitHub.

  2. Open up a Git-enabled terminal, and the fork you've created to your computer.

  3. into git-learning.

  4. the HelloWorld.java file, and replace "Hello, Conflicts!" with another phrase of your choice.

  5. HelloWorld.java.

Dealing with Merge Conflicts

Once everyone has changed code and committed, one of the programming leads will push a commit that will cause a to the Spartronics repository. Merge conflicts are incredibly common when working collaboratively, and learning how to resolve them is an important skill.

  1. Stage and commit your merge-resolved HelloWorld.java file.

Opening Pull Requests

Now that you've dealt with your merge conflicts, the next step is to get your changes into upstream - the Spartronics organization's copy of git-learning. In a usual season, your code will also be reviewed by the subteam leads and mentors you're working with, and implement feedback accordingly.

  1. Request review from one of the programming leads from the right sidebar.

  2. Submit your pull request, and you're done!

Make sure you're in the git-learning directory, and (git pull upstream master).

You should be alerted of - edit the offending file, and resolve them manually.

Make sure you're in the git-learning directory, and .

Navigate to the Spartronics4915 git-learning repository, and from your fork.

pull from upstream
merge conflicts
push your commits to your fork
open a pull request
Install Git.
Configure your username and email.
fork
git-learning repository
clone
Change directory
Edit
Stage and commit
merge conflict
Git Tutorial
Staging and Committing Code
Dealing with Merge Conflicts
Opening Pull Requests