Course

Best practices

Image

Contribute to Open Source

Contributing to open-source projects is a great way to your coding skills, learn new technologies, and with other developers.

It also enhances your portfolio, showcasing your to work on diverse projects and your commitment to continuous learning.

Insight

Contribute to at least 5 projects. Find open-source projects you like and make contributions.

Best Practices for Contributing

  1. Find Projects You’re Interested In

    • Explore different github repositories to find projects to get started.
    • Look for projects that align with your or technologies you want to learn.
  2. Understand the Project

    • Read the project’s README, CONTRIBUTING.md, and any other documentation.
    • Familiarize yourself with the project’s codebase and structure.
  3. Start Small

    • Begin with , manageable tasks such as fixing bugs, improving documentation, or adding minor features.
    • Look for issues labeled or
  4. Communicate

    • Engage with the project maintainers and community. Join project and ask for guidance if needed.
    • Clearly explain your proposed changes and feedback.
  5. Follow Contribution Guidelines

    • Adhere to the project’s contribution guidelines and coding standards.
    • Ensure your pull requests are and tested.
  6. Learn from Feedback

    Accept constructive feedback and use it to your contributions.

Resources

Here are some platforms and resources to help you find open-source projects to contribute to:


Sensitive Files

Image

Including sensitive files like files in your repository can critical information such as API keys, database credentials, and other private data. This can lead to security and access to your systems.

Best Practices for Handling Sensitive Files

  1. Secure ENV Files

    • Keep your files local or in private environments. Do not commit them to your repository.
    • Use environment variables management tools like HashiCorp or Doppler for secure handling.
  2. Use .gitignore

    • Create a file in your repository to specify files and directories that Git should
    • Include patterns to ignore files and other sensitive data.
  3. Provide a .env.example

    • Include a file in your repository with placeholder values for the required environment variables.
    • This helps other developers set up their environment correctly without exposing sensitive information.
Image
  1. Clear Documentation

    • Explain the environment setup in your README file.
    • Provide instructions on how to create and configure the file based on the template.

Inactivity

GitHub tracks and publicly reports your activity as a developer in something called The Github Activity Graph it's impossible to fake.

Image

Keep your GitHub profile by regularly committing and participating in projects. The more active and involved you are, the more you appear to others

gitignore

You can use tools like gitignore.io to generate git ignore content for a specific language or framework


Branching

Even when working alone on a GitHub project, effective use of branching is essential to maintain a main codebase while isolating and managing different features, bug fixes, and experiments separately.

This practice ensures development, collaboration in the future, and the ability to test changes without compromising the integrity of the main branch.

Insight

Effective branching leads to organized development, easier collaboration, and the ability to test changes safely.

Best Practices for Branching

Image
  1. Create Branches for Each Feature or Bug Fix

    • : Work on features or fixes in isolation to avoid disrupting the main codebase.
    • : Makes it easy to track changes and review code.
  2. Use Clear and Descriptive Branch Names

    • : Follow a naming convention for clarity and organization.
    • : Use names that clearly describe the branch’s purpose.
  3. Keep the Main Branch Deployable and Stable

    • : Use branch protection rules to prevent direct commits to the main branch.
    • : Integrate and test branches before merging to ensure stability.
  4. Regularly Merge Finished Work Back to the Main Branch

    • : Use PRs for code reviews and discussions before merging.
    • : Choose an appropriate merge strategy (e.g., squash and merge, rebase and merge).
  5. Experiment with New Ideas in Separate Branches

    • : Use branches for experimental features or major changes.
    • : Integrate experiments only after thorough testing.
  6. Delete Branches That Are No Longer Needed

    • : Regularly delete merged or stale branches to maintain a clean repository.
    • : Prevent confusion and clutter in your project.

Branch Naming Conventions

Using consistent naming conventions for branches helps maintain and in your project. Here are some common conventions:

  1. Feature Branches:

    Example
    • Prefix: feature/
    • Example: feature/user-authentication
    • Purpose: For new features or enhancements.
  2. Bug Fix Branches:

    Example
    • Prefix: bugfix/
    • Example: bugfix/login-issue
    • Purpose: For bug fixes.
  3. Hotfix Branches:

    Example
    • Prefix: hotfix/
    • Example: hotfix/critical-bug
    • Purpose: For critical fixes that need to be addressed immediately.
  4. Release Branches:

    Example
    • Prefix: release/
    • Example: release/1.0.0
    • Purpose: For preparing a new release.
  5. Experiment Branches:

    Example
    • Prefix: experiment/
    • Example: experiment/new-layout
    • Purpose: For experimental features or significant refactoring.
  6. Chore Branches:

    Example
    • Prefix: chore/
    • Example: chore/update-dependencies
    • Purpose: For maintenance tasks like updating dependencies or refactoring code.

Resources

Visit the “Learn Git Branching” website for a visual demonstration of how branching works in Git.


All of these steps will help you create a great GitHub project, which will make your profile stand out and show that you are a good developer.

0 Comments

"Please login to view comments"

glass-bbok

Join the Conversation!

Subscribing gives you access to the comments so you can share your ideas, ask questions, and connect with others.

Upgrade your account
tick-guideNext Lesson

Profile ReadMe Template