Hello Controllers, welcome to the tutorial on Git and Github. In this tutorial, we would look at a few common git workflows for a quick and easy way to collaborate/backup your code.
Git is a version control system that allows you to track changes to files. It is a distributed version control system, which means that the entire codebase and history is available on every developer's computer, which allows for easy branching and merging.
Git is a version control system, which means that it keeps track of all the changes made to a file. This allows you to easily revert to a previous version of the file if you make a mistake. It also allows you to easily collaborate with others on the same codebase.
- Repository: A repository is a collection of files and folders that are tracked by Git.
- Commit: A commit is a snapshot of the repository at a particular point in time. It is a collection of changes to the repository.
- Branch: A branch is a parallel version of the repository. It allows you to work on a particular feature without affecting the main codebase. Once you are done with the feature, you can merge the branch back into the main codebase.
- Merge: Merging is the process of combining two branches together. It is usually done when you are done working on a feature and want to merge it back into the main codebase.
- Pull Request: A pull request is a request to merge a branch into the main codebase. It is usually done when you are done working on a feature and want to merge it back into the main codebase.
- Fork: A fork is a copy of a repository. It allows you to make changes to the repository without affecting the original repository. It is usually done when you want to contribute to an open source project.
- Clone: A clone is a copy of a repository in your local machine.
- Push: Pushing is the process of uploading your changes to the remote repository.
- Pull: Pulling is the process of downloading the changes from the remote repository.
- Create a new repository on Github.
- Clone the repository to your local machine.
- Copy the codebase into the cloned repository.
- Commit and push the changes to the remote repository.
- Using Github Desktop, choose the option to create a new repository from existing codebase.
- Choose the codebase and the location of the repository.
- Commit and push the changes to the remote repository.
- Create a new branch.
- Make the changes.
- Commit and push the changes to the remote repository.
- Create a pull request to merge the branch into the main codebase.
- Wait for your supervisor to review the changes and merge the branch.
- Create a file called
.gitignore
in the root directory of the repository. - Add the names of the files/folders you want to ignore in the
.gitignore
file. - Commit and push the changes to the remote repository.
Common gitignore files can be found here Gitignore Files
- Fork the repository
- Create a file in the
Attendance
folder with your name as the filename. In that text file, write your name and how you plan on using Github in your research journey. - Commit and push the changes to the remote repository.
- Submit a Pull Request to merge the changes into the main repository.