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.
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
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.
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!
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
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!
On October 21st, 2020 we hosted a webinar titled, Step Up You DevOps Game with 4 Key Integrations for Jira and Bitbucket. We had a great showing and high engagement, but that meant th...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events