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

Default ignore file

ChuckieAJ
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 16, 2021

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
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 17, 2021

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

ChuckieAJ
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 17, 2021

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
AUG Leaders

Atlassian Community Events