Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
+1 vote
2 views
in DevOps and Agile by (19.4k points)
edited by

I am using git and working on the master branch. This branch has a file called app.js.

I have an experiment branch in which I made a bunch of changes and tons of commits. Now I want to bring all the changes done only to app.js from experiment to master branch.

How do I do that?

Once again I do not want a merge. I just want to bring all the changes in app.js from experiment branch to master branch.

1 Answer

+2 votes
by (27.5k points)

Say, you are on the 'master' branch. Now you want to get 'app_new.js' file from 'new-feature' branch.

Use the following command: 

$ git checkout new-feature path/to/app_new.js

git checkout file from branch - How to get just one file from another branch
Intellipaat-community
by (5.8k points)
thanks for this

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...