Skip to content

Instantly share code, notes, and snippets.

@avinal
Created December 8, 2024 13:04
Show Gist options
  • Save avinal/8014b26080887979ddc821bacbba4f86 to your computer and use it in GitHub Desktop.
Save avinal/8014b26080887979ddc821bacbba4f86 to your computer and use it in GitHub Desktop.

Open Source Contribution Flow

  1. Find a project
  2. Find an objective - issue already present, created new, fecture, bug
  3. Fork and clone the project
git clone https://github.com/avinal/git-session
  1. Configure your clone
git remote -v
origin	[email protected]:avinal/git-session.git (fetch)
origin	[email protected]:avinal/git-session.git (push)
upstream	[email protected]:avinal/git-session.git (fetch)
upstream	[email protected]:avinal/git-session.git (push)
git config list
[email protected]
user.name=Avinal Kumar
  1. create a new branch, never use main branch
git switch -c avinal/issue1
  1. Make the change/contribution
  2. Stage your changes git add BOOKS.md
  3. Commit your changes git commit -s
  4. Push your changes git push origin avinal/issue1
  5. Creating a pull request
  6. Resolving conflicts
  7. Fetch the upstream main git fetch upstream main
  8. Rebase and resolve issues git rebase upstream/main
  9. Add your changes
  10. Rebase continue git rebase --continue
  11. Rebase abort if needed git rebase --abort
  12. Push with force if needed git push origin avinal/issue1 -f

Amending the commits

  1. You make the changes
  2. You stage your changes git add BOOKS.md
  3. You amend your commit git commit --amend

Resetting your commits

  1. reset commit git reset --soft HEAD~

DCO - Developer Certificate of Origin

Vim commands

  • to insert i
  • to save and exit :x
  • to delete a line dd
  • to come back to normal mode ESC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment