wiki page for Github: (version control, release engineering, continuous integration) - devuxd/SeeCodeRun GitHub Wiki
This page has answers to some of the frequent asked questions and guides for Github: (version control, release engineering, continuous integration)
FAQ’s:
1) How do branches work in the SeeCodeRun project?
In this Project, you will create a branch for yourself where you can try out your ideas and start working on your part of the project. The Changes that you make on your branch will not affect the master branch and hence free to experiment and commit changes.
Your branch in the project can be merged after it's reviewed by other Team members you're collaborating with when you make a pull request in the SeeCodeRun project.
Your branch name should be descriptive, so that others can see what is being worked on.
For more information on Github flow and branch creation, refer to: https://guides.github.com/introduction/flow/
2) When I commit a change, which branch should I commit to?
Every Team member, work and make changes on their branch and as the changes stabilize, they should be committed to their branch. Each commit has an associated commit message. This message needs to be clear as it makes it easier for other people to follow along and provide feedback
If you prefer to make use of any Local Repository on your PC:
You can work and make changes on a branch in the local repository and as the changes stabilize, they should be committed to your local repository's branch. The commit should be merged back to master and pushed to github.
If you want to make use of GUI github client software:
You may choose one from among the ones specified in this link : https://git-scm.com/download/gui/linux I have tried a couple of GUI’s and prefer using “SourceTree” on Windows platform.
3) How does this commit get propagated to other branches?
Initially, you make a pull request and initiate discussion about your commits. Anyone in the team can see exactly what changes have been made. After the members of the team review the changes, the code is merged into the master branch.
4) How do I ensure that my branch is up to date? How often should I do this?
To ensure that your branch is up to date you have to make a pull request.
When a branch is created from the default branch or the master branch, you’re making a copy of the original branch as it was at that point in time. If the original branch changes while you’re working on your new branch, you should make a pull request so that you can pull in those updates.
How often should I do this?
You can make use of a feature called ‘compare’ in Github to check if differences occurred between your branch and the original branch.
Select the branch you made, to compare with master branch (the original). Then Look over your changes in the diffs on the Compare page. If you notice any updates, click the “create pull request” button in order to pull in those updates into your branch.
5) What should I do if I get a merge conflict?
When you try to merge your branch with the master branch and a conflict exists, a “Merge Conflict” error message is displayed by git. You should look over the changes in the diffs on the compare page and find out where exactly the conflict is caused. The area that is causing a conflict between the branches is marked using angular brackets by git. You will have to look and make the required changes in this area to resolve the conflict. Now, you have to commit these changes to be able to merge the branches without any conflict.
6) Can I have Github run my Jasmine unit tests at commit time to make sure I did not break anything? How?
Github supports continuous integration providers that will automatically run a unit test suite whenever a pull request is created. One such way to do this is to create a semaphore account and add your GitHub to Semaphore. Setting up continuous integration for a project hosted on GitHub and running your first build on Semaphore is simple.
Refer to the following link for information on creating semaphore account and adding your GitHub to Semaphore: https://semaphoreci.com/docs/adding-github-bitbucket-project-to-semaphore.html
Following link is a 2 minute video tutorial on how to integrate your project: https://semaphoreci.com/github_integration
One you integrate your project, semaphore will run the build and whenever you push new branches will be added and removed automatically.
Semaphore also carries out unit tests automatically: Whenever somebody pushes new code to GitHub, Semaphore immediately runs all tests for you. Your project can always be on the right track. Refer to the following link for more info: https://semaphoreci.com/automatic_testing?source=next
7) How do I push my updated code or new files from cloud9 into my branch on github ?
After you login to your Cloud9 account, open your seecoderun repository. Once, you add new files to this repository or update any existing file with new lines of code, You may push commit these changes and push it to your github account using the following commands:-
-> Click "Alt+T" to open terminal in your cloud9 account. -> Use "git add ." to add changes -> Use "git commit -m 'any description about the commit' ->Finally use "git push origin (your branch name without brackets)" to finally push code into your branch on github. -> If you want to switch from master branch to your branch before you push your code: Use command "git checkout yourbranchname".
For more info: Watch the video between 4th min to 8th min. https://www.youtube.com/watch?v=vnXi0gGTVS8