SOFTWARE ENGINEERING LECTURE WED SEP 9th

Course Announcements and Upcoming MCJ Unit

  • Core CS review assignment grades and feedback are available on Canvas.

  • Code must be compiled before submission to ensure syntax correctness.

  • String output capitalization details are critical for automated unit tests and CI/CD pipelines.

  • Starter repositories for the Git and GitHub assignment are available on AppState Enterprise GitHub under organization CS Classroom 3667 with semester code 202640.

  • Repositories follow the standard naming structure: 202640-[assignment-name]-[username].

  • The upcoming MCJ unit covers Make (build automation platform), CheckStyle (code format linter), and JUnit (automated unit testing framework).

  • Schedule: Git and GitHub quiz is due Wednesday next week; Git and GitHub assignment is due Monday the following week.

Git Merge Types and Merge Conflicts

  • Fast-forward Merge: Occurs when no new commits exist on main/master since branching; Git moves the head pointer forward to the tip of the feature branch.

  • Two-way (Recursive) Merge: Occurs when both main/master and the feature branch have new independent commits; Git automatically combines changes into a new merge commit.

  • Merge Conflict: Occurs when the exact same line of the same file is edited differently across two merging branches.

  • Git pauses automated merges when conflicts occur and inserts conflict markers (<<<<<<< HEAD, =======, >>>>>>> [branch-name]).

  • Conflicts can be resolved using text editors like VIM or using the VS Code Merge Editor (providing Accept Current, Accept Incoming, or Accept Combination options).

  • Workflow to finalize conflict resolution: resolve markers in the file, stage changes with git add, and run git commit to complete the merge commit.

Working with Git Remotes

  • Git Remote: A shared repository hosted on a central platform (e.g., GitHub or Bitbucket) for distributed version control collaboration.

  • git clone [URL]: Creates a local copy of a remote repository along with its commit history and .git metadata.

  • git remote add origin [URL]: Links a local repository to a remote server using the default alias origin.

  • git remote -v: Lists all configured remotes for a repository.

  • git push -u origin [branch]: Uploads local commits from a specific branch to the designated remote repository.

  • git fetch: Retrieves remote updates and commit history without merging them into working local branches.

  • git pull: Fetches remote updates and automatically merges them into the current local branch.

Questions and Discussion

  • Prompt: What type of merge occurs if no changes were made to master since branching?

    • Response: A fast-forward merge.

  • Prompt: What type of merge occurs if changes were made to master in non-conflicting locations?

    • Response: A two-way (recursive) merge.

  • Prompt: Is everyone exhausted from Labor Day weekend?

    • Response: Acknowledged student fatigue following the holiday.

  • Prompt: Has anyone worked with GitHub or Bitbucket in the past?

    • Response: Audience reported minor experience; Bitbucket was clarified as a Git host similar to GitHub.