Step 1: Initialize Git in Your Project
Navigate to your project directory and initialize Git: bash Copy
cd /path/to/your/project git init
Step 2: Set Your Git Identity
Configure your name and email (if not already set globally): bash Copy
git config --global user.name "Your Name" git config --global user.email "you@example.com"
Step 3: Add a .gitignore File (Optional)
Create a .gitignore file to exclude unnecessary files (e.g., build artifacts, temporary files): bash Copy
nano .gitignore
Add the following content (customize as needed): plaintext Copy
*.ko *.mod.c *.mod.o *.o *.order *.symvers *.cmd .tmp_versions/ Module.symvers modules.order
*.swp *.swo
Step 4: Add and Commit Your Files
Add your files to the staging area and commit them: bash Copy
git add . git commit -m "Initial commit: Add project files"
Step 5: Create a GitHub Repository
Go to GitHub and log in.
Click the + button in the top-right corner and select New repository.
Fill in the repository name, description, and choose Public or Private.
Click Create repository.
Step 6: Link Your Local Repository to GitHub
Add the remote repository URL (replace username and repo-name with your GitHub details): bash Copy
git remote add origin https://github.com/username/repo-name.git
Step 7: Push Your Files to GitHub
Push your files to GitHub: bash Copy
git push -u origin main
If your default branch is master instead of main, use:
bash
Copy
git push -u origin master