0

I am using Git on visual studio 2017 .

In our projects, for running in development mode ,some changes need to be done on some config files on our branch (created from Master Branch ).

Note : Those changes(which are in config files for running the project locally) need not to be push in upper branch.

As we know that Before taking latest from Master Branch in GIT ,we need to commit all changes .

Please suggest me , Is there any way that I can take Back up of Modified Files before taking Latest from Upper Branch or How can we take latest from Master Branch into our local branch if we have modified files in (Changes Tab of Team Explorer).

Jumbo
  • 35
  • 8
  • If you want to commit the changes at some point later you can just make a 'git stash', put the changes in a stash and after pulling bring them back with 'git stash apply'. But maybe you should consider ignoring this config files completely if they are only used for local runs. – Christos Batzilis Jun 21 '18 at 10:05
  • thanks Christos , i will search more on Git stash – Jumbo Jun 21 '18 at 10:17

1 Answers1

0

git stash is useful to get the files out of the way during the pull. However, it sounds like you don't want push these config files to the remote repository. In that case you need to worry about them both when you pull, and when you push.

For that case it is customary to add the files to a .gitignore file. Then git will not update them when you pull, (and it will let you pull even if they are changed), and git will not try to push the changes to those files.

Here is a discussion of using .gitignore How do I ignore files in a directory in Git?

Randy Leberknight
  • 1,363
  • 9
  • 17