You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
I want to skip a file named .gitignore during creation of the zip i tried -x and --exclude command but it is not working here is my code .
pipelines: branches: main: - step: name: Copy code as ZIP file script: - apt-get update && apt-get install -y zip - git archive --format=zip HEAD -o code.zip -x .gitignore artifacts: - code.zip
I searched on forum but cannot find any solution
G'day @Robin
Based on your YML parameter, you can't use -x on the git archive. Instead, try the following example to exclude .gitignore
pipelines:
branches:
main:
- step:
name: Copy code as ZIP file
script:
- apt-get update && apt-get install -y zip
- git archive --format=zip HEAD -o code.zip ":(exclude).gitignore"
artifacts:
- code.zip
Use ":(exclude).gitignore" to skip .gitignore when it's archiving.
I hope this helps.
Cheers,
Syahrul
+ git archive --format=zip HEAD -o code.zip ":(exclude).gitignore/"
fatal: There is nothing to exclude from by :(exclude) patterns.
Perhaps you forgot to add either ':/' or '.' ?
Not working for me this is from logs.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Robin
Interesting, this works as expected on my end. As you can see on the screenshot below, it skipped the .gitignore when creating the zip file:
May I know what image are you using? I've read that older git may have issues using (exclude) parameters. I'm using the default image "
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.