lab 1: trello & git - hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf ·...

43
CSE4006: Software Engineering Lab 1: Trello & Git Software Engineering Lab Except where otherwise noted, the contents of this document are Copyright 2016 Gayeon Kim, Gwanggyu Choi, Scott Uk-Jin Lee. All rights reserved. Any redistribution, reproduction, transmission, or storage of part or all of the contents in any form is prohibited without the author's expressed written permission.

Upload: others

Post on 22-Mar-2020

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

CSE4006: Software Engineering

Lab 1: Trello & Git

Software Engineering Lab

Except where otherwise noted, the contents of this document are Copyright 2016 Gayeon Kim, Gwanggyu Choi, Scott Uk-Jin Lee. All rights reserved. Any redistribution, reproduction, transmission, or storage of part or all of the contents in any form is prohibited without the author's expressed written permission.

Page 2: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

Trello

Page 3: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

Sign up

https://trello.com/home

Page 4: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

Create a New Board

• Click ‘Create new board’

• Click Trello logo

Page 5: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a
Page 6: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

Add New List

• Click Add a list • Set name of a list

Page 7: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

Add a new Item

• click add a card then setting item name

Page 8: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

• Edit the description • Write a description

Page 9: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

• You drag you want move item

Item able to move between the list

Page 10: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

Delete item and list

• List • Item

• Move to archive

Page 11: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

• You can delete or restore in archive

but list can’t delete

• Item • List

Page 12: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

More• You can set item member,label,checklist,due date and attachment

• Checklist

Page 13: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

• Add Members • Labels • Due Date

Page 14: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

• Attachment

Page 15: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

1. Create a new board

2. Create a set of List

-My information,Portfolio,Hobby&interest,Doing

3. Add information,career,resume,contact,phone number item in My information List

4. Add an item of the thing that you are doing now in Doing List and set item Due date

5. Add items (your project, paper or etc) in Portfolio List and set Label(team, solo, domestic, global…)

6. Add items representing your interest or bucket list in Hobby & Interest List and set checkbox(your bucket list)

7. Delete phone your number item

Exercise 1

Page 16: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

Example

Page 17: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

https://trello.com/guide http://buildbettersoftware.com/with-trello/

http://www.infoq.com/articles/scrum-trello http://wpcurve.com/trello-for-project-management/ https://trello.com/b/UTc6X4FS/-

Additional

Reference

Page 18: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

https://github.com/

Github

Page 19: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

You can think of a version control system (short: "VCS") as a kind of "database".

VCS(version control system)

Page 20: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

• Collaboration Without a VCS in place, you're probably working together in a shared folder on the same set of files

• Storing Versions (Properly) Saving a version of your project after making changes is an essential habit. But without a VCS, this becomes tedious and confusing very quickly

• Back up A side-effect of using a distributed VCS like Git is that it can act as a backup

• Understanding What Happened Every time you save a new version of your project, your VCS requires you to provide a short description of what was changed.

• Restoring Previous Versions Being able to restore older versions of a file (or even the whole project)

Why use VCS

Page 21: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

Git work flow

Page 22: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

OS X • http://sourceforge.net/projects/git-osx-installer/

Windows • http://msysgit.github.com/

Linux • $ apt-get install git

Install

Page 23: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

Create a New Remote Repository

Sign in https://github.com

Page 24: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

Create a New Remote Repository

Page 25: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

Create a New Local Repository

• Create a new folder and repository

$ git init

Page 26: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

Create a New File

• Create a new file

Page 27: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

Add and Commit Files

$ git add <file name> $ git add *

Add all files

•Add the created file,

‘hello.txt’, and track it

Page 28: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

•Check git repository status

$ git status

Page 29: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a
Page 30: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

Add and Commit Files

•Write commit message and commit added files

$ git commit -m “<message>”

Page 31: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

View commit logs

$ git log

Page 32: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

Connect to Remote Repository

$ git remote add origin <URL>

$ git push -u origin master

Page 33: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

Get Files From Remote Repository

• Clone files from repository of the remote server

$ git clone <URL>

Page 34: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

Push and Pull at Remote Repository

$ git push origin master

• Push updates in local to remote server • *If you want to push to other branch input the branch name instead master

$ git pull

• Synchronize local repository with remote repository

Page 35: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

Edit Files

• Change the ‘hello.txt’ ,create new file

Page 36: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

View Changes

• Compare the added file with the committed file

$ git diff

Page 37: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

Cancel Added Files

Create and add a text file, ‘todo.txt’

$ vi todo.txt

$ git add *

• Remove a specific file in the staged state

$ git rm --cached todo.txt

Page 38: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

Ignore Files

Create ‘.gitignore’ and add the name rules for files to be ignored

$ vi .gitignore

Check that it works

$ git add *

$ git status

Page 39: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

Commit Missing Files

$ git commit --amend

If you want to add missing file or change the commit message

$ git commit -m “asdf”

$ git add forgotten_file

$ git commit -m “I forgot”

These three lines are considered as one commit

Page 40: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

Turn Back to the Recent Commit

$ git checkout <filename>

$ git checkout

• If you want to turn a specific file or all of files back to the recent commit

Page 41: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

Change Files and Remove

$ git rm <filename>

• Remove a file

$ git mv <filename> <new_name>

Change file name

* If you change file name without using this command, git considers the existing file is removed and the new file is created

Page 42: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

Exercise 2

1. Create an remote repository

2. Create a program if you press “1” that print your email (language of your choice)

3. Add and commit local repository

4. Upload to your remote repository

5. Add a function to print your phone number when you press “2”

6. Update your remote repository

Page 43: Lab 1: Trello & Git - Hanyangselab.hanyang.ac.kr/courses/cse406/2016/labs/lab1.pdf · 2016-03-10 · •Collaboration Without a VCS in place, you're probably working together in a

Additional

A cheat sheet of common Git commands

• https://training.github.com/kit/downloads/github-git-cheat-sheet.pdf

Git simple guide

• https://rogerdudler.github.io/git-guide/index.ko.html