Skip to content

Path for Current working branches to merge with main

Akhil edited this page Dec 23, 2024 · 7 revisions

Problem: The current working branch contains the entire commit history. Merging it with main will bring the entire commit tree back.

Solution Overview The easiest way to remove LinkedIn code is by merging with the main branch, which contains all refactoring changes that separate the linkedin functionality. After refactoring, removing LinkedIn automation code simply requires deleting the LinkedIn package in the jobs_portals package.

Refactoring Steps

Initial Setup

  1. Checkout to branch "main_with_git_tree" to access the git commit tree of main
  2. Merge your current branch with "main_with_git_tree" to sync with the main (with commit tree)
  3. Resolve all merge conflicts
  4. Test branch stability before proceeding

Note: kindly reach out to me for access to this branch.

Branch Creation

  1. Create a new branch from current main (note: this will have different git tree/commit history)
  2. Copy and paste (choose replace file) code state from the branch created in the initial setup
sudo rsync -a --exclude='.git/' ../Auto_Jobs_Applier_AI_Agent_copy/ ../Auto_Jobs_Applier_AI_Agent/
  1. Verify changes using git diff to see the delta
  2. Delete the LinkedIn package from the jobs_portals package

Commit and Push Changes

1.Add all files to the new commit:

git add -A
  1. Commit the changes:
git commit -m "<commit message>"

3.Push the new branch:

git push origin <branch-name>

Keynote: To successfully merge with the current main, ensure your new branch is created from current main.