If it is not explicitly told in following recipe, setting up services are described for Ubuntu 20.04 server, but applications are described for Xubuntu 20.04 workstation. If you use different Ubuntu version or Linux distribution, settings as well as content, names and places of configuration files may be different!
Got it.

21. Git branches and merges

Review the presentation Version Control

Tasks

  1. If necessary, install the meld compare and merge tool:

    sudo apt install meld
  2. Open your project:

    cd ~/workspace/xxxxxxx
  3. Add, commit, and push changes to your project to tools.odo.lv (to make sure you have everything saved on the server tools.odo.lv).
  4. Add a new remote repository entry to your project:

    git remote add upstream ssh://user@tools.odo.lv/home/git/JTM/

    where user is the actual username of your git repository

  1. Pull branches branch1 and branch2 from the upstream repository into the same branches in your project:

    git fetch upstream branch1:branch1
    git fetch upstream branch2:branch2
  2. Check if your project has three branches:

    git branch

    returns:

    branch1
    branch2
    * master
  3. Create two copies of your project, for example xxxxx-1 and xxxxxx-2 as sibling projects in your workspace.
  4. View branches in project copies:

    cd ~/workspace/xxxxx-1
    git checkout branch1
    cd ~/workspace/xxxxx-2
    git checkout branch2
  5. Open meld and compare the contents of your original project, for example xxxxxx and xxxxx-1, copy and save the missing parts of the content in project xxxxx.
  6. Compare the contents of the catbN.txt files in the jtm.activity21 package between the projects with the master and/or branch1/branch2 branches.
  7. Merge the contents of all numbered files catbN.txt into a single catb.txt file.
  8. Verify that the file catb.txt has the correct contents by running the GitMergeTest1.java unit test.
  9. Before add, commit, and push changes to the server tools.odo.lv, make sure you are working with the master branch, for example:

    git branch

    returns:

    branch1
    branch2
    * master

More information


  

Created by Valdis Vītoliņš on 2025-01-28 17:51
Last modified by Valdis Vītoliņš on 2025-01-28 17:51
 
Xwiki Powered
Creative Commons Attribution 3.0 Unported License