Progress Continues
We've already had 21502 updates since Dolphin 5.0. Keep up with Dolphin's continuing progress through the Dolphin Blog: February, March, and April 2024 Dolphin Progress Report. |
The Dolphin Emulator Wiki needs your help! Dolphin can play thousands of games, and changes are happening all the time. Help us keep up! Join in and help us make this the best resource for Dolphin. |
Git: Difference between revisions
m (→Introduction: s/see/show/) |
m (add to Development category) |
||
Line 50: | Line 50: | ||
== Dolphin-specific Git(Hub) Workflow == | == Dolphin-specific Git(Hub) Workflow == | ||
See [[Contributor's Guide]]. | See [[Contributor's Guide]]. | ||
[[Category:Development]] |
Revision as of 18:33, 12 April 2014
Introduction
If you have never used Git before, here is a quick intro to get you started:
First, set up Git:
sudo apt-get install git # install Git (assuming you are using some Debian-based Linux like Ubuntu) git config --global user.name "John Doe" # commits will be attributed to this identity git config --global user.email johndoe@example.com
Now go to https://github.com/dolphin-emu/dolphin and fork the repository.
git clone git@github.com:YourUserName/dolphin.git # download your fork locally cd dolphin # change into the newly cloned repository (the complete history is inside .git/) git checkout -b cool_new_feature # create a branch for what you are working on $EDITOR some/file.cpp # serious hacking git status # show changed, new or deleted files git add some/file.cpp # mark changes to be committed (adds them to the "staging area") git status # show what is staged git commit # editor pops up, edit the commit message, save, close git push origin cool_new_feature # publish the branch at GitHub
Now you can create a pull request on GitHub.
Your pull requests are tied to your branches. GitHub automatically adds new commits to existing pull requests. To work on something new, always create and checkout a new branch. Otherwise you might accidentally push unrelated commits into one of your previous pull requests. Try to base each pull request on upstream/master so they can be merged independently.
To keep up-to-date:
git remote add upstream https://github.com/dolphin-emu/dolphin.git # add a separate remote for the main repository git remote -v # now you have two remotes (origin and upstream) git fetch upstream # update your clone git checkout master # make sure you are on the master branch git merge --ff-only upstream/master # fast-forward to the newest commit of the remote upstream branch
If you messed up and want to delete all uncommitted changes (be careful!):
git reset --hard
Useful Git Commands
git show # show last commit git diff # diff current working directory to last commit git log --graph # draw ASCII graph of Git history git commit --amend # add changes in staging area to previous commit git rebase -i upstream/master # rebase current branch onto master and interactively select order of commits, meld commits together, or delete some git reflog # show list of recent hashes (even commits outside of the history, would be garbage-collected when left alone)
It may be useful to know that Git branches are actually just labelled pointers into the commit graph.
Dolphin-specific Git(Hub) Workflow
See Contributor's Guide.