Atpakaļ
17. Web Application
Tālāk
19. Software Project Management

18. exercise: Git branches and merging tools

  1. If necessary, install meld and diffuse tools:

    sudo apt install meld diffuse
  2. Open your project:

    cd ~/workspace/Aaaa

    where Aaaa is code of your project.

  3. Add new remote repository https://odo.lv/git/JTM/ to your project:

    git remote add upstream https://odo.lv/git/JTM/
  4. Add, commit and push changes of your project to the bcserver (to be sure you have all your previous work on bcserver).
  5. Pull branches branch1 and branch2 from upstream repository to branches into your repository:

    git fetch upstream branch1:branch1
    git fetch upstream branch2:branch2
  6. Check that your repository has three branches:

    git branch

    returns:

      branch1
      branch2
    * master
  7. Make two copies of your project, for example Aaaa1 and Aaaa2 as sibling projects in your workspace.
  8. Check out branches in copies of the project:

    cd ~/workspace/Aaaa1
    git checkout branch1
    cd ~/workspace/Aaaa2
    git checkout branch2
  9. Open meld, and compare content of your original project, e.g. Aaaa and Aaaa1, copy and save missing parts of content into Aaaa project.
  10. Compare content of catbN.txt files in jtm.activity18 package between projects with master and/or branch1/branch2 branches.
  11. Merge content of all numbered filees catbN.txt into single catb.txt file
  12. Check that catb.txt file has proper content by running GitMergeTest1.java unit test.
  13. Before you add, commit and push changes to bcserver, ensure you are working on master branch, e.g. command:

    git branch

    returns:

      branch1
      branch2
    * master

Additional info

On undoing, fixing, or removing commits in git

Atpakaļ
17. Web Application
Tālāk
19. Software Project Management
Tagi:
Izveidojis Valdis Vītoliņš 2018-03-26 10:55
Pēdējais mainījis Valdis Vītoliņš 2018-11-23 16:10
 
Xwiki Powered
Creative Commons Attribution 3.0 Unported License