Is there a way to exclude certain files when making pulling a repo via ssh?

U4EA22 August 10, 2023

I have a number of private repos I used in my projects.

Package.json: -

 

"myaccount/myrepo": "git+ssh://git@bitbucket.org/myrepo/blah.git"
Is there a way I can exclude certain files being pulled when this happens? I believe with npm this functionality is represented with the package.json "files" key or by inclusion of an .npmignore file.
Thanks.

1 answer

0 votes
Syahrul
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 10, 2023

G'day, @U4EA22 and Welcome to the community.

Can clarify your intention behind inquiring about excluding files during a git pull?

I ask because the purpose of git pull is to fetch commits from a remote repository and integrate them into your local branch. The standard git pull command does not offer a built-in feature to exclude specific files during the process. Its primary function is to retrieve and incorporate new commits into your local repository, including all tracked files.

If your objective is to prevent specific files from being overwritten or merged during a git pull, you might need to consider alternative strategies.

One approach is to use .gitignore to specify files or patterns that Git should ignore when performing operations like pull, commit, and push. This can help prevent unintended changes to specific files.

I hope this helps.

Regards,
Syahrul

U4EA22 August 10, 2023

Sorry, I meant to refer to it as installing, not pulling.

When I install the package via SSH, I would like to do so without installing certain files. For example, I might have a repo of UI components with a sub directory containing a react app to show examples but would only way to install the components library. Thanks.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events