Git to work with a group. Videos: Group - git work flow group overview Group - add group members Group - check out branch Group - merging branch Group - merging branch from group member Tasks Git Commands Working in a group: Project Manager Set up a project on your desktop in cs142/dev-lab3. Create a new project in gitlab and save the git commands (Be sure the commands are for SSH). You will need to send the git add remote origin commands to your group members On your computer initialize git in your project folder git init Connect to your repo git remote add origin git@gitlab.uvm.edu:YOURNAME/YOUR-REPO-NAME.git ex: git remote add origin git@gitlab.uvm.edu:robert-erickson/cs148b.git Add the files to commit git add -A Commit them locally git commit -m "message about what you did" Push to the cloud git push origin master Your project is all set up. On the git lab website add your group members to the project. Group members Set up your local machine Make a folder Initial the folder as a repo git init Add the remote that was emailed by the project manager. git remote add origin git@gitlab.uvm.edu:MANAGERUSERNAME/REPO-NAME.git Group work flow. Every Group member needs to follow these steps, every time without fail before working on any file. All commands are for your local computer. Make sure you have the groups master copy git pull origin master Check out a branch to work on so you don't mess up the master. Name the branch with your initials (all caps) followed by a dash and a short name of the task you are working on. For example I am going to work on the navigation git checkout -b RE_nav Make changes to your code as you would normally Sftp (run your NetBeans project) to server so you can make sure it works Verify your changes are working Add your changes to git (you can do git status first to make sure the files changed are the ones you expected to have changed). git add -A Commit your changes locally git commit -m "Added new menu item" Push your branch to gilab git push origin RE_Nav On the gitlab website look at your branch and submit a merge request. A member of the team should review the code to make sure it meets the teams standards (ie code review). At this point teh project mananger should make sure that the new code will not cause the site code to break. Once the code is approved on the gitlab website (people can make comments) the manager would then Accept the Merge Request (check the delete the branch as it's not needed anymore) Person who created the branch should now delete the branch locally on their machine. Before deleting you need to switch back to the master and pull the changes down git checkout master git pull origin master git branch -D RE_Nav Work Flow Process To summerize: work flow process (this is what you do daily) working in a group: On your computers develop folder you git pull origin master git checkout -B INITIALS_task Create/edit your php pages sSftp (run your NetBeans project) your files to your develop folder Verify that the pages are working on the develop server Locally on your computer in the development folder git status git add -A git commit -m "message about what you did" git push origin INITIALS_task Submit a merge request Request is reviewed Accept merge and delete branch git checkout master git pull origin master git branch -D INITIALS_task Repeat above till project is done. Manager would then pull changes. For this class, each member needs to have the site live so everyone needs to pull your changes to the live site. ssh to your hosting account ssh w3.uvm.edu -l yourusername cd to your live folder git pull origin master Verify that the pages are working on the live server Practice Following the work flow above one member should make a small change to one file. Member should submit merge request. Everyone should look at branch, comment. Manager should approve and merge. Now two members make a change to the same file. This should cause a merge conflcit. Resolve the merge conflict. Make a pdf (gitcommits.pdf) of you commits and save in your live-lab3 folder.