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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Default ignore file

This might be a bit late. I created an empty repository and prepared an initial commit of all of my files locally. This was then pushed to remote.

 

At this point I do not have a gitignore file.

 

The project is Visual Studio for Mac Xamarin Forms.

 

Is there a suitable gitignore file I can add to my repository? 

1 answer

1 vote

Hi @ChuckieAJ ,

I'll provide you with the default .gitignore file that Bitbucket creates when you create a new repo and select the option to include a .gitignore. Please note though that this should be customised, depending on what exactly you want to ignore in your own project.

If you add a .gitignore now in your existing repository, it will not have any effect on files that you added prior to adding the .gitignore.

If your existing repository still has only the initial commit and no extra commits, what you could do is create a new local repo, add and commit a .gitgnore specific to your project, then add and commit all your files, and push that to a new Bitbucket repo.

If your existing repository has more than one commits and you don't want to lose the history, then you can first rewrite history with a tool like BFG in order to remove from Git history the unwanted files/folders. Push to your Bitbucket repo, and then add a .gitignore file as well.

You can read more on Git ignore patterns you can use in .gitignore here:


An example of a .gitignore file that is added automatically to newly created Bitbucket repos (if the option to include a .gitignore is select) is the following:

# These are some examples of commonly ignored file patterns.
# You should customize this list as applicable to your project.
# Learn more about .gitignore:
# https://www.atlassian.com/git/tutorials/saving-changes/gitignore

# Node artifact files
node_modules/
dist/

# Compiled Java class files
*.class

# Compiled Python bytecode
*.py[cod]

# Log files
*.log

# Package files
*.jar

# Maven
target/
dist/

# JetBrains IDE
.idea/

# Unit test reports
TEST*.xml

# Generated by MacOS
.DS_Store

# Generated by Windows
Thumbs.db

# Applications
*.app
*.exe
*.war

# Large media files
*.mp4
*.tiff
*.avi
*.flv
*.mov
*.wmv

Please feel free to let me know if you have any questions.

Kind regards,
Theodora

Thanks. I found a bespoke file here for Xamarin .gitignore file.

Like Theodora Boudale likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

3,826 views 10 16
Read article

Community Events

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

Events near you