-
Install Git:
- Download and install Git from git-scm.com.
- Follow the installation instructions for your operating system.
-
Configure Git:
- Open a terminal or command prompt.
- Set your username:
git config --global user.name "Your Name" - Set your email address:
git config --global user.email "your.email@example.com"
-
Visit GitHub:
- Go to the GitHub repository you want to fork.
-
Fork the Repository:
- Go to https://github.com/alingrig87/java-algo
- Click the "Fork" button in the top-right corner of the repository page.
- This creates a copy of the repository in your GitHub account.
-
Clone the Forked Repository:
- Open your terminal.
- Clone the forked repository to your local machine:
git clone https://github.com/your-username/repository.git
- Replace
your-usernamewith your GitHub username andrepositorywith the name of the repository.
-
Navigate to the Cloned Repository:
cd repository -
Create a new file:
- create new file test.txt
- add some random text
-
Stage and Commit:
- Stage your changes:
git add . - Commit your changes:
git commit -m "Your commit message here"
- Stage your changes:
-
Push Changes to Your Fork:
- Push the committed changes to your fork on GitHub:
git push
- Push the committed changes to your fork on GitHub:
6 Commit Message Best Practices
When making commits, it's a good practice to follow a consistent format for commit messages. Use the following prefixes to categorize your commits:
- feat: Add user authentication
- feat: Implement responsive design for mobile
- feat: Introduce new API endpoint for data retrieval
- fix: Resolve issue with login button alignment
- fix: Fix bug causing data corruption in module X
- cleanup: Remove unused dependencies
- cleanup: Refactor code in module Y for clarity
- chore: Update build scripts
- chore: Reorganize project structure
- config: Update database configuration
- config: Add new environment variables
- doc: Update README with installation instructions
- doc: Add API documentation for endpoints
- doc: Clarify usage of configuration settings
- refactor: Simplify logic in module A
- refactor: Extract common functions for reuse
- refactor: Improve variable naming in class B
- misc: Add new utility functions for handling dates
- misc: Update third-party dependencies
- misc: Address code review feedback