git &github
Git and GitHub Training Overview
Introduction to Git and GitHub
Purpose of Git and GitHub
Git is a version control system, while GitHub is a platform to host projects that utilize Git.
Important for managing code versions and collaboration.
Onboarding Process
Previous instruction from a lecturer about Git and GitHub.
Emphasis on understanding workflows and moving forward with using these tools effectively.
Importance of Git and GitHub for students
Use them for official submissions and building a portfolio over time.
Connecting to the Virtual Machine (VM)
Process for accessing the VM
Log on to the virtual machine (VM).
Remember: Download the connection file only once.
Use provided password to connect.
Avoiding Drag-and-Drop
Do not drag and drop files between your local computer and the VM as it can be very slow.
Best method for file transfer: Upload files to Google Drive, then access it from the VM.
Reminder of potential pitfalls of storing files directly between the VM and personal machine.
Accessing the VM Setup
Steps to access the VM using a redeem code
Redeem code must be acquired from an email sent by the department head.
Login to the portal mentioned and follow instructions to set the VM for first-year students.
Verify and use correct credentials for access.
What to do after VM is running
Click on "Show connection information" to obtain your password.
Ensure the VM is in the running state before trying to connect.
Setting Up GitHub Account
Establishing a GitHub account
Students must sign up for a GitHub account.
Recommendations for username: use either a student number or full name without spaces.
Importance of identifiable usernames for easy recognition in submissions.
Email Considerations
Use student email to verify account and receive notifications.
Ability to change primary email and username in the future for professional purposes.
Understanding Git and GitHub Concepts
Differentiating Git from GitHub
Git: Version control software specific to projects and folders, keeping a history of changes (initiate with
git init).GitHub: A platform for hosting repositories that utilize Git.
Key Commands and Workflow
Workflow includes commands such as:
git init: Initializes a new repository.git add .: Adds changes to staging area.git commit -m "message": Saves changes to the repository with a message.
Importance of committing changes
Regular commits help characters historical changes.
Ability to revert to previous project states if needed.
Installing Git on Personal Machines
Git installation process
Visit Git SCM website and install the latest version (e.g., 2.5.3 for 64-bit).
After installation, verifying Git with
git --versioncommand in the command prompt.Setting user credentials for Git:
Use commands:
git config --global user.name "Your Full Name"git config --global user.email "your.email@student.com".
Creating and Managing Repositories on GitHub
Process of creating a repository
Go to GitHub and create a new repository.
Repository name should be aligned with project name from NetBeans.
Types of Repositories
Private repositories are only accessible by you while public repositories can be seen by all.
Important notes about folder structure
GitHub works with entire project folders, not just single files.
Avoid drag-and-drop for uploading files to ensure the full project is sent.
Using NetBeans with Git
Starting a project in NetBeans
Create a new project and recognize the project location in the filesystem.
Initializing Git in NetBeans
Follow steps to initialize and manage Git commands from NetBeans alongside command prompt.
Importance of keeping track of changes using Git commands.
Final Workflow Steps
Essential Git commands for ongoing development
After initial push, subsequent changes can be updated with just three commands:
git add .git commit -m "your message"git push -u origin master
Importance of understanding commit history and pushing changes incrementally.
Rounding Off
Key takeaways
Regular commits, identifiable usernames, and understanding the toolset.
Preparing to use Git and GitHub for classroom submissions and assignments.
Future lessons will continue to elaborate on GitHub Desktop and more advanced Git functionalities.