Fundamentals 3 min read

Resolve Git File Conflicts in One Simple Step

This guide walks you through opening the conflicted file, removing Git conflict markers, choosing between keeping the local version or the remote version, and finalizing the fix with three Git commands, ensuring the error is eliminated.

liandk
liandk
liandk
Resolve Git File Conflicts in One Simple Step

1. Open the conflicted file

utils/config.js

2. Delete all conflict markers and keep the desired code

Option A – Keep your local old version

Remove the sections between <<<<<<< HEAD and

>>>>>>> ab144a19901c5593760857037f2eddbe0fc4c569

, leaving only:

export const APP_VERSION_CODE = 259;
export const APP_VERSION_NAME = '2.26.1601';
export const IMG_BASE_URL = 'http://alyimg.xxxxxxxx.com';
export const ESIGN_BASE_URL = 'https://app.xxxxxxxx.com:8083';
export const API_BASE_URL = 'https://app.xxxxxxxx.com';

Option B – Use the remote new version (recommended)

Replace the whole file with the following code:

// 从 manifest.json 中读取应用版本信息
import manifest from '@/manifest.json';
export const APP_VERSION_CODE = Number(manifest.versionCode) || 260;
export const APP_VERSION_NAME = manifest.versionName || '2.26.0101';
export const IMG_BASE_URL = 'http://alyimg.xxxxxxxx.com';
export const ESIGN_BASE_URL = 'https://app.xxxxxxxx.com:8083';
export const API_BASE_URL = 'https://app.xxxxxxxx.com';

3. After resolving the conflict, run three commands

git add utils/config.js
git commit -m "解决版本号冲突"
git pull

Done

The conflict is resolved and no further errors will appear.

Quick recap

The symbols <<<<<, =====, >>>>> are conflict markers and must be removed manually.

Keep the correct code after editing.

Saving and running git add plus git commit finalizes the resolution.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Gitconflict resolutioncommand-linetutorialversion control
liandk
Written by

liandk

Seasoned Java and mobile developer with years of experience, specializing in mini‑programs, public accounts, and full‑stack front‑end development. In the AI era, I continuously learn to broaden my knowledge and evolve. I revived a public account I started a decade ago during a dessert‑startup venture, using code as a vessel and knowledge as a companion. I share personal projects, technical articles, programming tips, and growth insights—let’s improve together and set sail.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.