main
will be our only branch as this is a small project- Test locally first
- Ask for help on discord if you need help
- Git commit in small chuncks
-
Create a new feature branch and run
git checkout main git checkout -b YOUR-NEW-FEATURE
-
Make changes and commit:
git status ... lists out the list of changed files ... git add filenames
Commit change
git commit -m "your commit message here"
- Make meaningful commit messages, describe what you did etc
-
Try pulling from
main
and reoslve conflicts if they exist:git pull origin main
-
Push to git
git push origin YOUR-NEW-BRANCH
-
In your github. Click on create pull request
- Name the branch based on the naming convention
After which, add the appropriate tag onto the pull request before merging
-
Once the branch has been merged into the
main
branch dogit pull origin main # Pull from github to main branch git branch -d YOUR-NEW-BRANCH
git status
: This shows you the files that have been modified and are "unstaged"git branch -l
: This tells you which branch you are on currently. Notice the * next to the branch.git checkout branchname
: This switches to an existing branch. To access a remote branch, rungit fetch
first.git checkout -b branchname
: Creates a new branch locallygit push origin branchname
: This pushes your commits to the remote branch associatedgit push -u origin branchname
: This creates a branch remotely. If it already exists, it will fail.