How Can We Help?
Forking/Branching Workflow
Before beginning this procedure, it is a good idea to remove all copies of the repository from your computer. If you are concerned you might lose something, you can alternately move all copies of the repository to a backup location where they will not be confused with the working copy.
Setup
For this tutorial the ULB repository will be used as an example.
- Fork the ULB repository on DCS (https://git.door43.org/door43/en_ulb).
- Clone the official ULB repository to your computer.
git clone -v --progress https://git.door43.org/Door43/en_ulb.git C:\Users\Phil\Projects\en_ulb
- Add your fork as a new remote named “myfork”.
Working
- Commit all changed files.
git commit -am "Description of the change"
- Pull the latest master branch from DCS.
- Click “Pull”
- Check “Fetch from all remotes”
- Click “Pull”
git fetch --all
git pull
- Switch to the master branch if it is not already checked out.
git checkout master
- Add a new branch.
- Select “Branch”
- Select “Add Branch”
- Type new branch name such as “working”
- Click “Add Branch & Checkout”
git checkout -b working
- Right-click “myfork” in Branches pane
- Select “Push to”
- Select “myfork” in the Target Repository dropdown
- Click “Push”
git push -u myfork working
- Make your changes. Note: you can add the new branch any time before the changes are committed.
- Commit changes to the new branch.
git commit -am "Description of the change"
- Push the branch to “myfork” not “origin.”
- Right-click “myfork” in Branches pane
- Select “Push to”
- Click “Push”
git push
- Create a Pull Request on DCS in the master ULB repository to merge your branch into the master branch.
- Switch to your fork on DCS in web browser
- Select “Pull Requests” tab
- Click “New Pull Request(?)”
- Add pull request message
- Click “Pull Request”
- Ask someone to review your Pull Request.
- The person who reviews and approves the Pull Request will merge it.
- Delete your branch, locally and from DCS, after it has been merged. This is not required, but it keeps the Branches pane free of clutter.
- Right-click on the branch name under “Local Branches” in the Branches pane. Do not delete the branch named “master.”
- Check both boxes in the dialog that pops up, “Delete tracked branch” and “Delete from remote.”
- Click the Delete button.
git checkout master
git branch -d working
git push myfork --delete working
git fetch --all
git pull