Reputation: 46
I am trying to figure out how to push partial file changes from my local git repo to a tfs git project.
For some background, I have a project that uses an external wsdl. I have a local dev instance of the wsdl on my machine, and the production application will run on a production version of the wsdl hosted on a different server. I have the project in my local git repository pointed to my local dev wsdl, and the production project in tfs pointed to the remotely hosted wsdl.
My issue is that when I push code changes from my local dev repo to the tfs repo, I don’t want my connections to the dev wsdl being pushed with the changes. My end goal is to be able to make code changes, bug fixes, etc, and push those to the tfs repo without changing any of the production configurations.
I may be going about this incorrectly, but figuring out the best way to tackle this is why I’m here. Are there specific procedures developers usually use to handle this kind of situation?
Upvotes: 0
Views: 614
Reputation: 1
You can install the "commit groups" vs code plugin, which allows him to upload the grouped files
Upvotes: 0
Reputation: 13944
Here some suggestions maybe you can have a try:
.gitignore
for your repository to ignore the files you do not want to push.For example:
git add path/to/file1 path/to/file2 path/to/file3
git commit -m "commit message"
git push
In this example, only the files path/to/file1
, path/to/file2
and path/to/file3
will be pushed to remote repository.
git pull
or git fetch
command to update local repository.Upvotes: 1
Reputation: 31093
Since you have different configuration file between branches, when you perform merge, you would get conflicts. For this scenario, you could check Merge Strategies.
You can also use Git attributes to tell Git to use different merge strategies for specific files in your project. One very useful option is to tell Git to not try to merge specific files when they have conflicts, but rather to use your side of the merge over someone else’s.
This is helpful if a branch in your project has diverged or is specialized, but you want to be able to merge changes back in from it, and you want to ignore certain files. Say you have a database settings file called
database.xml
that is different in two branches, and you want to merge in your other branch without messing up the database file. You can set up an attribute like this:database.xml merge=ours
And then define a dummy
ours
merge strategy with:$ git config --global merge.ours.driver true
If you merge in the other branch, instead of having merge conflicts with the
database.xml
file, you see something like this:$ git merge topic Auto-merging database.xml Merge made by recursive.
In this case,
database.xml
stays at whatever version you originally had.
.gitattributes
- is a root level file of your repository that defines the attributes for a subdirectory or subset of files.
Upvotes: -1