Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7962647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:23:50+00:00 2026-06-04T05:23:50+00:00

I have a git repository where I store template files that I often use,

  • 0

I have a git repository where I store template files that I often use, I did a checkout of the latest version a couple of days ago and made local changes to these template files.

I just made change to the template files master repository and now I want to checkout the most recent version of my master branch but I don’t want to have my local changes deleted.

How can I merge the changes from the master branch into my working copy?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T05:23:52+00:00Added an answer on June 4, 2026 at 5:23 am

    To take full advantage of the merge (or rebase) tactics of git, you could commit the changes to your local repository and then pull. Pull results in a merge between the remote and local repositories, which may be a fast-forward or a recursive merge depending on the upstream changes. You may even want to create a new branch for this (which you can then push to the origin if you want without affecting the master branch).

    The stash could help you here, but you run the risk of the stash not being able to apply after the pull.

    Simple example:

    git add .
    git commit -m 'My local template changes'
    git pull origin master # fix any conflicts
    

    New branch example:

    git checkout -b newbranch
    git add .
    git commit -m 'My local template changes'
    git pull origin master # fix any conflicts
    

    The latter merges the remote changes in master into your local newbranch, but bear in mind that in this situation your local copy of master would still be behind (i.e. if you then did a git checkout master you’d still need a git pull to get the changes).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have setup a git repository in a linux server, and installed the latest
I have a central git repository that everyone pushes to for testing and integration,
I have a bare git-svn repository and did a 'git svn fetch' on it.
I have a bare repository that's used as the central store for my project.
I have a private SVN repository that I use for all of my projects.
I am trying to use a program that uses git as the backing store
I have a Git repository I store random things in. Mostly random scripts, text
I have a git repository (and working directory) that is stored in my Dropbox
I have a codebase that (until now) used git to store its dependencies. The
Suppose I have Git repository like this: git-repo/ directory_1/ directory_2/ directory_3/ This has a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.