-
Notifications
You must be signed in to change notification settings - Fork 9
Using GitHub
github.com/[org]/[repo] (org web) |
github.com/[user]/[repo] (user web) |
~/github/[repo] (user local) |
|
---|---|---|---|
->1x | -> fork | -> clone | |
<- | merge pull request {admin} <- | <- [pull request](Fork & Pull Model) | <- push, <-> commit |
where:
-
[org]
is an organization (eg ohi-science) -
[repo]
is a repository in the orgranization (eg ohicore, ohiprep, etc.) -
[user]
is your github username
See:
In this example, pull request ohi-science/ohicore#94 for bbest/ohicore to update ohi-science/ohicore returns the message:
We can’t automatically merge this pull request. Use the command line to resolve conflicts before continuing.
Checkout via command line
If you cannot merge a pull request automatically here, you have the option of checking it out via command line to resolve conflicts and perform a manual merge.
HTTP: https://github.com/bbest/ohicore.git
Step 1: From your project repository, check out a new branch and test the changes.
git checkout -b bbest-master master git pull https://github.com/bbest/ohicore.git master
Step 2: Merge the changes and update on GitHub.
git checkout master git merge --no-ff bbest-master git push origin master
Here are the extra steps to resolve this conflict. First, you need a local copy of ohi-science/ohicore in a temporary directory.
cd /Users/bbest/Github_Mac
mkdir tmp; cd tmp
git clone https://github.com/ohi-science/ohicore.git
cd ohicore
Then checkout a new branch bbest-master based on master, and overwrite with the bbest repo.
git checkout -b bbest-master master
git pull https://github.com/bbest/ohicore.git master
The Auto-merging will then detect CONFLICTs. In this case:
CONFLICT (content): Merge conflict in inst/extdata/tmp/layers_navigation_2012a_2013a.csv
Look at the various versions of the file
# local
open inst/extdata/tmp/layers_navigation_2012a_2013a.csv
# ohi-science web
open https://github.com/ohi-science/ohicore/blob/master/inst/extdata/tmp/layers_navigation_2012a_2013a.csv
# bbest web
open https://github.com/bbest/ohicore/blob/master/inst/extdata/tmp/layers_navigation_2012a_2013a.csv
Let's overwrite with the raw online version of the file from the bbest repo.
curl -L -o inst/extdata/tmp/layers_navigation_2012a_2013a.csv "https://raw.github.com/bbest/ohicore/master/inst/extdata/tmp/layers_navigation_2012a_2013a.csv"
Once the conflicts are resolved, mark the resolved file(s) with git add
and then commit with a message.
git add inst/extdata/tmp/layers_navigation_2012a_2013a.csv
git commit -m "resolved conflict with inst/extdata/tmp/layers_navigation_2012a_2013a.csv by overwriting with bbest version"
git status
Finally, merge the branches and push back to github.
git checkout master
git merge --no-ff bbest-master
git push origin master
-
ohicore milestones on HuBoard - excellent overview
-
maintain ordering by editing
order
in top comment of issue:<!--- @huboard:{"order":0.01,"custom_state":""} -->
-
GitHub Issues 2.0: The Next Generation - lots of useful tips, including keyboard shortcuts
-
GitHub Mention @somebody. They're notified.
including
@user
in issue comments notifies that person and subscribes to future updates. -
Trying to enable creation of issues via email alone:
- Connect GitHub to Email via IFTTT doesn't seem to work based on my recipe: Send [email protected] an email tagged #ohicoreIssue from [email protected].
-
Closing Issues Across Repositories
Now you can include "fixes user/repo#45" in your commit message, and it will close the referenced issue, provided you have the permission to push to that repository.
-
curl -i -u bbest https://api.github.com/issues
-
github-issues-import - this Python script allows you to import issues and pull requests from one repository to another
-
tutorial: Team Collaboration With GitHub
- A review paper describing how git can be used to improve reproducibility in science
- Productivity in RStudio [bbest]: data wrangling with dplyr, versioning with github, documenting with markdown (note: presentation itself done in RStudio with markdown in presentation mode)