Git is the most popular program for software version control which helps track changes in code when multiple people are working on the same set of files, allows you to save versions of your work and return to them later, see differences between versions, and even share work with other team members. Git is like the google docs of software development. Git is widely used in industry; expect to use it or something like it daily if you become a software engineer. Make sure to download git on windows at: https://git-scm.com/download/win Download for git on Mac is at: https://git-scm.com/download/mac While 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. Now create an account on Github. Example 1: 1. Go to: https://github.com/Team2537 2. Navigate to !RookiesTest 3. Click the clone or download green button and copy the URL 4. Open up FRC VS Code 5. Press: Ctrl + Shift + P (A search bar will pop up) 6. Type in "Git: clone" and click once it emerges 7. Paste the URL from the github website and press enter 8. A tab will appear at the bottom right of the screen. Press "Open Repository" You have just cloned your first repository! By using VSC and the !GitHub website, you've made a copy of the code on the website. Team Development Commands For git to be truly effective, you have to be able to make changes as a team. Commands include: - git commit - once you've edited your copy of code, this command records your changes and lets you leave a note. - git add - adds new files you've created inside the code. - git push - this command uploads your committed changes to the main repo on the website - git clone (what we first used) - creates a copy on your computer not effected by other people's edits - 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. Example 2: 1.Go to https://github.com/ 2. Click the plus sign at the top left of the page 3. Click new repository 4. Name the Repository !HelloWorld 5. Ignore the Description 6. Leave it on the public button 7. Check initialize README.md 8. Click Create repository 9. Click on the README.MD file and click the pencil icon to edit. 10. in the next line, type #hello world 11. Scroll down to "Commit Changes", type in "added hello" and press Commit changes 12. Click the clone or download green button and copy the URL 13. Open up FRC VS Code 14. In Vs Code, Press: Ctrl + Shift + P (A search bar will pop up) 15. Type in "Git: clone" and click once it emerges 16. Paste the URL from the github website and press enter 17. A tab will appear at the bottom right of the screen. Press "Open Repository" 18. add a new file named "hello.java" by right-clicking under the README.md on the left 19. Type in {{{ public class hello{ public static void main(String args[]) { System.out.println("Hello World"); } } }}} 20. Run it to check. 21. Press: Ctrl + Shift + P (A search bar will pop up) 22. Type in "Git: Commit" 23. Two windows will pop up; say Yes to both. 24. Type in "added hello.java" and press ENTER 25. Press: Ctrl + Shift + P and type in Git: push. 25. Check on github to see your changes. Other terminology: - 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? == == Past years resources * [http://git.ataber.pw/users/sign_in GitLab Server] (source code) - see: [mailto:aft.pokemon@gmail.com Alex Taber] for username/password access