![Page 1: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/1.jpg)
A short tutorial on Git
Servesh Muralidharan 4 March 2014
![Page 2: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/2.jpg)
This Tutorial
• What is Source Control • Distributed source control with Git • Git in Assignment 5 • Using Gitlab • Using git in Eclipse • More about Assignment 5
![Page 3: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/3.jpg)
This Tutorial
• What is Source Control • Distributed source control with Git • Git in Assignment 5 • Using Gitlab • Using git in Eclipse • More about Assignment 5
![Page 4: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/4.jpg)
What is Source Control l Tracks changes to files l Maintains history of changes l Maintains snapshots l Enables collaboraHon
l Main operaHons l add: mark files on the hard drive to be tracked in the repository
l commit: commit to the repository the changes in files on the hard drive
l …
![Page 5: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/5.jpg)
Distributed Source Control • Allows mulHple
repositories – each one is a copy of the main repository (usually)
• All repositories can be synchronized – clone: creates a local copy of the main repo
– push the changes from the local repository to the main repo
– pull the changes from the main repo to the local one
![Page 6: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/6.jpg)
Distributed Source Control with Git Git a popular program to use distributed source control OperaHons: • add • commit • push • pull • …
![Page 7: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/7.jpg)
This Tutorial
• What is Source Control • Distributed source control with Git • Git in Assignment 5 • Using Gitlab • Using git in Eclipse • More about Assignment 5
![Page 8: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/8.jpg)
Git in Assignment 5
• Teams of 2 – by Friday, 7 March: form teams – if you haven’t formed team by then you will be assigned a partner
• Each team will use one git repository for the assignment (details to follow)
• Marking: – Correctness (common for both team members)
– Performance (common for both team members)
– contribuHon to the git repository (for each student)
![Page 9: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/9.jpg)
hTps://code.google.com/p/giHnspector/
![Page 10: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/10.jpg)
Git in Assignment 5
l Make sure you commit code only from your user name
l Code changes, amount of code contributed, type of changes, etc., would be used to calculate individual member's marks
l Not necessary for you to use advanced git features
l You will not loose or gain points for using or not using features of git
![Page 11: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/11.jpg)
This Tutorial
• What is Source Control • Distributed source control with Git • Git in Assignment 5 • Using Gitlab • Using git in Eclipse • More about Assignment 5
![Page 12: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/12.jpg)
Using Gitlab with eclipse 1. First Hme (one user does this)
l Create a remote repo in gitlab l Create a local repo l Add files to local repo l Commit to local l Push (local à globa)
2. Every other Hme (same user, on the same computer) l Pull global to local l Change files on disk l Add more files to local repo l Commit (local) l Push (local à global)
3. Every other Hme (every user, on different computer) l Clone the remote repository l Change / add files l Commit l Push
![Page 13: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/13.jpg)
First Hme (one user does this)
l Create a remote repo in git lab l Create a local repo l Add files to local repo l Commit to local l Push (local à globa)
![Page 14: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/14.jpg)
1. Goto www.gitlab.scss.tcd.ie 2. Log in using scss username / password
![Page 15: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/15.jpg)
3. In the dash board click on the '+' symbol
![Page 16: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/16.jpg)
4. Specify a project name 5. Select visibility level to be 'Private' 6. Click on 'Create Project’
![Page 17: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/17.jpg)
7. Click on 'hTp' buTon 8. Make a note of the url highlighted in yellow
![Page 18: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/18.jpg)
9. Select 'secngs' tab on the top, followed 'members' on the led 10. Select New project member
![Page 19: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/19.jpg)
11. Search for your team mates name in the 'people field' 12. All users with scss account should be visible 13. Select Project Access level to what you desire, ex: Team Leader – Master and the rest as Developer.
![Page 20: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/20.jpg)
14. Ader adding all of your team mates, add the following members of CS2012 staff as Reporters. (1) Vasileios Koutavas (2) Servesh Muralidharan (3) Aravind Vasudevan (4) Shixiong Xu (5) Yu Xu Important : To be able to access and mark your project
![Page 21: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/21.jpg)
First Hme (one user does this)
l Create a remote repo in git lab l Create a local repo l Add files to local repo l Commit to local l Push (local à globa)
![Page 22: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/22.jpg)
1. You can choose your workspace directory in 'U' Drive, if you don’t want to keep secng up eclipse on every system or alternaHvely you can use your personal machine
![Page 23: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/23.jpg)
2. Choose import wizard from file menu.
![Page 24: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/24.jpg)
3. Select 'Git' followed by 'Projects from Git'
![Page 25: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/25.jpg)
4. Choose the 'URI' opHon
![Page 26: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/26.jpg)
5. Provide the link you saved from the gitlab 6. Provide your scss username and password.
![Page 27: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/27.jpg)
7. Since this is an empty repository eclipse will warn you about it, select next.
![Page 28: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/28.jpg)
8. Select a directory where you want to create the local repository
![Page 29: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/29.jpg)
9. The master password warning is not required to get rid of it click on 'yes' and select cancel on the next step
![Page 30: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/30.jpg)
10. Click cancel to ignore master password creaHon
![Page 31: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/31.jpg)
11. Since its an empty repository, you need to use the New project wizard
![Page 32: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/32.jpg)
12. Select 'Java Project' as the type
![Page 33: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/33.jpg)
13. Provide project name, note it should be the same name that you used in the gitlab server 14. The rest of opHons leave it at default and click 'Finish’
![Page 34: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/34.jpg)
15. Eclipse will take a few sec and create the project
![Page 35: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/35.jpg)
16. Right click on project name in project explorer window then select Team followed by Commit
![Page 36: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/36.jpg)
17. Type in your commit message 18. Select 'All the files' in your project 19. Click on commit and push
![Page 37: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/37.jpg)
20. Eclipse displays the message showing the successful commit and the creaHon of master branch
![Page 38: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/38.jpg)
First Hme (one user does this)
l Create a remote repo in git lab l Create a local repo l Add files to local repo l Commit to local l Push (local à globa)
![Page 39: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/39.jpg)
1. Add a file to the java project as usual
![Page 40: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/40.jpg)
First Hme (one user does this)
l Create a remote repo in git lab l Create a local repo l Add files to local repo l Commit to local l Push (local à globa)
![Page 41: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/41.jpg)
2. Right click on project name in project explorer window then select Team followed by Commit
![Page 42: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/42.jpg)
3. Commit and push the changes, but make sure to add the newly created files
![Page 43: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/43.jpg)
4. NoHce a new node being created for the commit of the file
![Page 44: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/44.jpg)
Every other Hme (same user, on the same computer)
l Pull global to local l Change files on disk l Add more files to local repo l Commit (local) l Push (local à global)
![Page 45: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/45.jpg)
1. To fetch or push from the repository, select the project name followed by Team and then choose either 'Fetch from upstream' or 'Pull' for pull
![Page 46: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/46.jpg)
Every other Hme (same user, on the same computer)
l Pull global to local l Change files on disk l Add more files to local repo l Commit (local) l Push (local à global)
![Page 47: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/47.jpg)
1. Right click on project name in project explorer window then select Team followed by Commit
![Page 48: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/48.jpg)
2. Commit and push the changes, but make sure to add the newly created files
![Page 49: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/49.jpg)
Every other Hme (every user, on different computer)
l Clone the remote repository l Change / add files l Commit l Push
![Page 50: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/50.jpg)
1. You can choose your workspace directory in 'U' Drive, if you don’t want to keep secng up eclipse on every system or alternaHvely you can use your personal machine
![Page 51: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/51.jpg)
2. Choose import wizard from file menu.
![Page 52: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/52.jpg)
3. Select 'Git' followed by 'Projects from Git'
![Page 53: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/53.jpg)
4. Choose the 'URI' opHon
![Page 54: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/54.jpg)
5. Provide the link you saved from the gitlab 6. Provide your scss username and password.
![Page 55: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/55.jpg)
7. When you reach the Branch selecHon window you should find the already created master branch. 8. If you get permission error or unable to access the repository ensure that you have the relevant access privileges when the team lead creates them 9. AlternaHvely you can log into your gitlab account and should noHce the project you have been added under
![Page 56: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/56.jpg)
10. Specify the locaHon where the local repository should be created
![Page 57: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/57.jpg)
11. Make sure you choose 'Import exisHng projects'
![Page 58: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/58.jpg)
12. Finally click on finish to complete the import of the exisHng project
![Page 59: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/59.jpg)
Every other Hme (every user, on different computer)
l Clone the remote repository l Change / add files l Commit l Push
![Page 60: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/60.jpg)
1. Add a file to the java project as usual
![Page 61: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/61.jpg)
Every other Hme (every user, on different computer)
l Clone the remote repository l Change / add files l Commit l Push
![Page 62: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/62.jpg)
1. Right click on project name in project explorer window then select Team followed by Commit
![Page 63: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/63.jpg)
2. Commit and push the changes, but make sure to add the newly created files
![Page 64: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/64.jpg)
3. NoHce a new node being created for the commit of the file
![Page 65: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/65.jpg)
“Conflict resoluHon”
• Both partners edit the same lines of code èconflict – Git will refuse to push code onto remote repository
– Prompts for resoluHon
• ResoluHon: merge conflicts manually – In Eclipse: hTp://youtu.be/ZK20jVt7XEc – Commit/push again
![Page 66: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/66.jpg)
![Page 67: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/67.jpg)
Avoiding conflicts
l Simple soluHon l Team work l Decide on a funcHon for each team member l Only one team member modifies a parHcular funcHon at a Hme
l Commit and push code every Hme you have reasonable set of changes
l Always pull the code from the server before you modify exisHng code
• but it’s not tragic!
![Page 68: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/68.jpg)
This Tutorial
• What is Source Control • Distributed source control with Git • Git in Assignment 5 • Using Gitlab • Using git in Eclipse • More about Assignment 5
![Page 69: Ashorttutorialon Git - Trinity College Dublin · This"Tutorial" • Whatis"Source"Control" • Distributed"source"control"with"Git" • Git"in"Assignment5" • Using Gitlab" • Using](https://reader034.vdocuments.mx/reader034/viewer/2022042223/5ec9e2ad134a521b41312b53/html5/thumbnails/69.jpg)
Specifics for Assignment 5
• Deadline for secng up your team members, Friday, March 7th.
• Report to us if you don’t have a team. • Deadline for secng up a bare repository and each team member commicng and pushing a change is end of day Tuesday, March 11th.
• You would need to submit the team names, members and the git URL as a text document to the submission server.