Git Basic Usage Installation
Git Basic Usage Installation
Installation
Download and install git for your OS (Windows, Linux or Mac OS X)
https://git-scm.com/downloads
Open a command line prompt and run:
$ git --version
2. Create a new-branch
Use a separate branch for each feature or issue you work on. After creating a branch, check it out
locally so that any changes you make will be on that branch.
$ cd <USER_HOME>
$ cd TRAINER
$ git checkout -b feature
3. Update, add, commit, and push changes
Work on the feature and make commits like you would any time you use Git. When ready, push your
commits, updating the feature branch on GitHub
$ cd <USER_HOME>
$ cd TRAINER
$ git add .
$ git commit -m "Adding a change from the feature branch."
$ git push origin feature
4. Get your code reviewed
To get feedback on your code, create a pull request in GitHub. From there, you can add reviewers and
make sure everything is good to go before merging.
5. Resolve feedback
Now your teammates comment and approve. Resolve their comments locally, commit, and push
changes to GitHub. Your updates appear in the pull request.
6. Merge your pull request
Before you merge, you may have to resolve merge conflicts if others have made changes to the repo.
When your pull request is approved and conflict-free, you can add your code to the master branch.
Merge from the pull request in Github.
References
➢ https://git-scm.com/docs
➢ https://guides.github.com/activities/hello-world/
➢ https://guides.github.com/introduction/flow/
➢ https://guides.github.com/activities/forking/
➢ https://help.github.com/articles/fork-a-repo/
➢ https://help.github.com/articles/configuring-a-remote-for-a-fork/
➢ https://help.github.com/articles/syncing-a-fork/