Skip to content

Latest commit

 

History

History
74 lines (53 loc) · 2.65 KB

essential_git.md

File metadata and controls

74 lines (53 loc) · 2.65 KB

Essential Git

Git is a software designed for coordinating work among programmers and tracking changes. We will be using Git to coordinate with other developers (i.e. Bootcamp mentors) by downloading and submitting exercises.

If you are new to Git or would like a refresher, read through the 'Beginner', 'Getting Started' and 'Collaborating' sections of the Atlassian tutorials: https://www.atlassian.com/git/tutorials

Setting Up Local Workspace

  • Install Git.

  • Once you are done setting up git, you will need to fork this repo & work on your forked repo. You can follow the official docs to learn how to fork a repo.

  • Clone and change directory into the repository

git clone https://github.com/<your_github_handle>/IRIS-RoR-Bootcamp-2020.git
cd IRIS-RoR-Bootcamp-2020

In Git terminology, a repository is an independent project. Cloning a repository is to make a copy of an existing project. Here, we are copy the RoR bootcamp exercises.

  • Create and checkout to a new branch session_<n>_<your_name> where n is the session number.
git checkout -b session_1_abhishek_kumar

A branch represents an independent line of development. Thus, working in branches will help seperate your work from other participant's work as well as different sessions from each other.

Submitting Your Changes

If you are working on an session's exercises and the tests pass - you can submit your work for mentors to review, suggest improvements and applaud you for a job well done. It's optional but highly recommended.

  • Commit your changes.
git add .
git commit

Commits can be thought of as snapshots or milestones along the timeline of a project. Commits capture the state of project at that point of time. Read more

We are capturing the state to ensure that our changes can be shared with other people.

  • Push your changes.
git push --set-upstream origin <branch name>

We can transfer commits from local repository to a remote repository using push. This command takes our changes and uploads to the central repository, where it can be viewed by other collobarators.

When you create a pull request, you are requesting another developer (i.e. Bootcamp mentors) review your work and integrate with the rest of code.