In this tutorial, I will explain how to use Git for your projects and how to commit the changes,create the pull request and merge the pull request.
Commit the changes and create the pull request
- Clone the repository from git
git clone https://github.com/xxx/xxx.git
- Check the changes after implementation
- Add the file to staging
git add <filename>
- Add more files to staging
git add *
- Check the status of the file
- Commit the changes to local
git commit -m "Commit message"
- Check the commit log
- Send changes to the master branch of your remote repository:
git push origin master
- In left of the "Branch" menu, click the green Compare and Review button.
then click “Create pull request” and type a title and description for your pull request after that click “Create pull request”
the pull request looks like - https://github.com/xxx/xxxx/pull/123
Get the pull request and merge in master.
- Fetch the pull request
git fetch origin pull/150/head:150
- Merge the pull request with master
git merge 150
More useful commands
- Remove the all changes in modified files
git checkout .
- Remove the changes in particular file
git checkout ./fileName
- Remove all untracked files
git clean -f -d
- Revert the commitgit loggit revert commit-id