How to get all the components changed as part of last commit. If I download manually the latest commit it downloads everything from the branch. But my requirement is to get only components that changed during last commit.
Hi Prakash,
can you explain more about what you mean by 'download manually the latest commit' ?
Are you using the git pull command in your terminal on your machine?
The power of git - and what makes it different to other version control systems such as subversion - is that it does store the entire repository on your machine.
If you are interested in the inner workings of git, I can highly recommend this guide: https://www.atlassian.com/git
Hi Martyn,
Thanks for going though my question. As mentioned I would like to elaborate my requirements. Let's say I have added two new components (c1 and c2) to my repository and did the commit. So when I look at the commit I could see that c1 and c2 are added to the repository. Now my requirement is to get only these 2 components which are added newly to the repository via git commands, Hope this is more clearer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think I understand what you're trying to do.
Let's say you have a branch called my-branch where you have added the commit and the commit hash is d9063641 (this is made up).
The components are within the repository at the path path/to/components/one and path/to/components/two.
Some options to try:
I hope that helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry Martyn, I am still not clear. I am giving an example as below.
Let's say I had file1, file2, file3 in a branch called My_branch. That mean this branch is copied from master and master had already these 3 files. Now I have added file4 and file5 to My_branch as part of commit d9063641 (this is made up). That means now My_branch contains all five files. Here the delta changes are file4 and file5. I would like to get only changed components i.e. file4 and file5 from the branch. How can I achieve this with git commands
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prakash,
Can you please explain what you mean by "I would like to get only changed components i.e. file4 and file5 from the branch". You already have my_branch on your machine.
Would you like to:
A) Get this commit on to master?
If so, typically you could create a pull request for this, but we can discuss this more if this is your use case.
B) Get a list of what has changed in commit d9063641?
If so, the following commands will show you what changed between the previous commit and this commit
git diff d9063641~ d9063641
git show d9063641
I hope that helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Martyn,
Yes, I want to see what are the components (only name not in detail level) changed as part of current commit over last commit. That means difference should return only the names i.e. file4 and file5 rather what changes done inside the components.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In that case you could try
git log --name-only
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.