HOW TO PUSH YOUR CHANGES TO GIT HUB
-
Cut your own branch from
masterlocally, typing:git checkout -b name_of_your_branchand create remote copygit push --set-upstream origin name_of_your_branchThe name of your local branch must match the name of your remote branch. Example (You can see in terminal):* [new branch] nik -> nik -
Type
git branchto verify that you created the branch (your currently branch will appear in green)
-
Make your changes
-
Run
git status- your changes will appear in red -
Add ALL your changes to staging by typing
git add .OR
To add some of the changes, instead
git add .you can assign path to the file you want to commit after adding Example:git add /Users/sofia/IdeaProjects/AssessmentControl/src/test/resources/features/1.ObjectsPropertiesMethods/firstTest.feature -
Type
git statusto check that you added all the changes (they will be shown in green) -
To add your changes from stage to your branch, type
git commit -m "your_message_explaining_what_you_modified" -
Switch to master to update code on master branch Type:
git checkout masterAnd then:git pull -
Switch to your branch again Type
git checkout name_of_your_branch -
Type
git merge masterto make sure there won't be any conflicts in your future pull request. -
Run project to double check if it is not broken (if you fixed something, you need to commit changes one more time)
-
If there are no conflicts, you can push to github. Being on your branch, type
git push -
Once you collected all the changes on your remote branch, you can go ahead and create a Pull request on GitHub.
-
Switch to local master to update it
git checkout master, andgit pull -
Then switch to your branch
git checkout your_branch_name -
And update your branch
git merge master(With this command you will take changes from your local master and copy it to your branch)
Repeat steps 3-16 for each complete task