Changes between Initial Version and Version 1 of ControlSystems/SoftwareTeam/Training/Git


Ignore:
Timestamp:
Oct 22, 2019, 5:47:19 PM (6 years ago)
Author:
Eileen Wang
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ControlSystems/SoftwareTeam/Training/Git

    v1 v1  
     1Git is like the google docs of software development. It helps track changes in code when multiple people are working on the same set of files.
     2
     3Make sure to download git on windows at:
     4https://git-scm.com/download/win
     5
     6Download for git on Mac is at:
     7https://git-scm.com/download/mac
     8
     9While we can use the Git download for software development, VSC, the environment you have been using to write and run your code, has built in commands for git which we will be using for this tutorial.
     10
     11Now create an account on Github.
     12
     13Example 1:
     141. Go to: https://github.com/Team2537
     152. Navigate to RookiesTest
     163. Click the clone or download green button and copy the URL
     174. Open up FRC VS Code
     185. Press: Ctrl + Shift + P (A search bar will pop up)
     196. Type in "Git: clone" and click once it emerges
     207. Paste the URL from the github website and press enter
     218. A tab will appear at the bottom right of the screen. Press "Open Repository"
     22
     23You have just cloned your first repository! By using VSC and the GitHub website, you've made a copy of the code on the website.
     24
     25Team Development Commands
     26For git to be truly effective, you have to be able to make changes as a team.
     27Commands include:
     28- git commit - once you've edited your copy of code, this command records your changes and lets you leave a note.
     29- git add - adds new files you've created inside the code.
     30- git push - this command uploads your committed changes to the main repo on the website
     31- git clone (what we first used) - creates a copy on your computer not effected by other people's edits
     32- git merge -when two or more users make changes at the same time, conflicts will occur. VSC will ask you if you'd like to merge, meaning combining users' codes and having you manually edit any errors.
     33
     34Other terminology:
     35- Branches - when you want to focus on different assets in the code, it may be best to create a branch. This way, you won't have to deal with merge conflicts and can commit your changes freely. For example, often in our robot code, we will have a branch devoted to Arm mechanism or Autonomous version. Check the SpaceBase Repository on https://github.com/Team2537/Spacebase and click on the left-most white button "Branch: Main". Explore the other branches what differences or similarities do you see?
     36
     37
     38
     39