Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,560,193
Community Members
 
Community Events
185
Community Groups

Pull selected files from git repo in AWS

Hi I am new to code repositories and I am trying to create a custom action that allows me to pull only selected files from a AWS hosted codecommit repository. Where can I find examples or information on what I would need to complete this?

 

1 answer

0 votes
Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Oct 23, 2020

Hi @Pasquale Tedesco,

Welcome to Atlassian Community!

The concept of Git is that your local repository is a complete copy of the remote repository.  That being said, you can do a sparse clone of a repository by creating an empty repository locally and link it to the remote repository. 

mkdir <repo>
cd <repo>
git init
git remote add -f origin <URL> 

Once you created the empty repository you need to configure what it should pull from the remote.

git config core.sparseCheckout true

Now you need to tell Git which files you want to checkout by adding the paths to sparse-checkout

echo "some/dir" >> .git/info/sparse-checkout

And the last step is to pull from the remote

git pull origin master

Thank you for this information. I will try this and see how far I can get.

Hi  @Mikael Sandberg

Is there an easy way to achieve something like this in Sourcetree.Export.jpg

@Mikael Sandberg Just in case this comes up else where the solution I was able to find that best met our needs was the following.

1) Add new custom action
2) Script to run: Map path to 7zip.exe
3) Parameters: a C:\path\to\desktop\folder\$SHA.zip $FILE
4) Save Custom action and resart SourceTree
5) Open Repository
6) Select files to download
7) Right Click > Custom Action > select new custom action

ExportSourceFiles.jpg

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events