1. Forking a Repository
Go to the repo on GitHub.
Click Fork (top right).
Clone your fork:
git clone <your-forked-url>
Work on your computer, then push changes to your fork.
- Collaborating on GitHub
Use issues to report problems or suggest ideas.
Assign tasks to people.
Push your code and open a pull request.
Review and discuss changes with teammates.
Communicate clearly in comments.
- Creating a Pull Request
Make a new branch:
git checkout -b my-feature
Make and commit your changes:
git add .
git commit -m "what you changed"
Push your branch:
git push origin my-feature
On GitHub, click Compare & pull request.
Write a title and description, then submit.
- Resolving Merge Conflicts Pull latest code: git pull origin main
If there are conflicts, fix them in the files.
Add and commit the fixed files.
Push again:
git push
- Code Review Check the pull request.
Review code for quality and clarity.
Leave helpful comments.
Approve or request changes.
- Managing Issues Open an issue with a title and details.
Label and assign it.
Comment updates.
Close it when done.
- Basic Git Commands
git init # Start git in a folder
git clone <url> # Copy a repo
git status # Check changes
git add . # Stage changes
git commit -m "message" # Save changes
git pull # Update from remote
git push # Upload your changes
git checkout # b branch – New branch
git merge branch # Combine branches
- Pushing Changes Update your branch: git pull origin main
Commit your changes:
git commit -m "message"
Push:
git push origin your-branch
Open or update a pull request.
Top comments (0)