git clone https://github.com/jraymondt/portfolio.git
cd <repo dir>
To update to the latest version of the main branch
git checkout main
git pull origin main
Start a new branch for editing
git checkout -b new-version
- Modify files as needed, then stage and commit your changes
git add .
git commit -m "Describe your changes"
git push origin new-version
- Go to your repository on GitHub.
- Click Compare & pull request.
- Add details about the changes and click Create pull request.
- If you want to retain the old version alongside the new one, ensure you don't overwrite old files—consider keeping them in a dedicated folder like old-version/.
- If everything looks good, merge the pull request on GitHub.
git checkout main
git pull origin main
git checkout -b new-feature-branch
git add .
git commit -m "Made updates to portfolio"
git push origin new-feature-branch
Trolley bus
- If you’re not the project owner, start by forking the repository. This creates your own copy of the project under your GitHub account.
- You can do this by navigating to the original repo and clicking the Fork button.
- Open your terminal and clone your fork using:
git clone https://github.com/jraymondt/virtual-hotel-bootstrap.git
- This allows you to fetch and sync changes from the main project. Run:
git remote add upstream https://github.com/Azzo-1/virtual-hotel-bootstrap.git
- Never work directly in the main branch. Instead, create a separate branch for your changes:
git checkout -b james-features
git checkout james-features
- Modify files as needed, then stage and commit your changes
git add .
git commit -m "Describe your changes"
- Send your changes to your forked repository:
git push origin james-features
- On GitHub, navigate to your fork and click "Compare & Pull Request".
- Provide a clear description of your changes and submit the PR for review.
- Regularly sync with the main repository to avoid conflicts
git fetch upstream
git merge upstream/main
git fetch main
git merge main
git push upstream james-features
-
Once your pull request has been reviewed and approved by maintainers, it's ready to be merged
-
Typically, the repository owner or maintainer will handle the merge, but if you have appropriate permissions:
- Navigate to your pull request on GitHub
- Click the "Merge pull request" button
- Choose the appropriate merge method (merge commit, squash and merge, or rebase and merge)
- Confirm the merge
After merging, you can delete your feature branch since the changes are now in the main branch:
git checkout main
git branch -d james-features
git branch
git status
git branch -a
git branch -d branch-name
git checkout -b branch-name
git checkout main
git merge branch-name
git push origin branch-name
git push origin --delete branch-name
git checkout branch-name
git config --global user.email "james@jraymondt.com"
git config --global user.name "jraymondt"