Git: Difference between revisions

81 bytes removed ,  12 April 2014
m
→‎Introduction: fetch+merge -> pull
(start with a little Git introduction)
 
m (→‎Introduction: fetch+merge -> pull)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Introduction ==
== Introduction ==
If you have never used [http://git-scm.com/ Git] before, here is a quick intro to get you started:
If you have never used [http://git-scm.com/ Git] before, here is a quick intro to get you started. For Dolphin-specific workflows, read the [[Contributor's Guide]].


First, set up Git:
First, set up Git:
Line 15: Line 15:
git checkout -b cool_new_feature # create a branch for what you are working on
git checkout -b cool_new_feature # create a branch for what you are working on
$EDITOR some/file.cpp            # serious hacking
$EDITOR some/file.cpp            # serious hacking
git status                      # see changed, new or deleted files
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 add some/file.cpp            # mark changes to be committed (adds them to the "staging area")
git status                      # see what is staged
git status                      # show what is staged
git commit                      # editor pops up, edit the commit message, save, close
git commit                      # editor pops up, edit the commit message, save, close
git push origin cool_new_feature # publish the branch at GitHub
git push origin cool_new_feature # publish the branch at GitHub
Line 28: Line 28:
<pre>
<pre>
git remote add upstream https://github.com/dolphin-emu/dolphin.git # add a separate remote for the main repository
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 remote -v               # show remotes, you have two now (origin and upstream)
git fetch upstream                  # update your clone
git checkout master         # make sure you are on the master branch
git checkout master                 # make sure you are on the master branch
git pull --ff-only upstream # pull in new commits from upstream
git merge --ff-only upstream/master # fast-forward to the newest commit of the remote upstream branch
</pre>
</pre>


Line 48: Line 47:
It may be useful to know that Git branches are actually just labelled pointers into the commit graph.
It may be useful to know that Git branches are actually just labelled pointers into the commit graph.


== Dolphin-specific Git(Hub) Workflow ==
[[Category:Development]]
See [[Contributor's Guide]].
2,229

edits