-
Notifications
You must be signed in to change notification settings - Fork 8
Using Github with ED2
-
First fork pecan on github into your own github space (github help: "fork a repo")
-
Introduce yourself to GIT
git config --global user.name "FULLNAME" git config --global user.email [email protected]
-
If you are working from a cluster, you may need to set up ssh keys
-
Clone to your local machine
git clone [email protected]:<username>/ED2.git
- Define upstream
git remote add upstream [email protected]:EDmodel/ED2.git
1 - Get the latest code from the main repository
git pull upstream master
2 - Do some coding
3 - Commit after each chunk of code (multiple times a day)
git commit -m "<some descriptive information about what was done>"
4 - Push to YOUR Github (when a feature is working, a set of bugs are fixed, or you need to share progress with others)
git push origin <branchname>
5 - Before submitting code back to the main repository, make sure that code compiles
./scripts/build.sh -c
6 - submit pull request (see github documentation)
git pull [email protected]:<someone_else>/ED2.git master
If you attempt to do a pull that reports a merge conflict, or if you encounter a merge conflict when doing a pull request you'll need to do a fetch instead of doing a pull. Fetch grabs all the changes from another repository, but it doesn't commit those changes and thus you have a chance to reconcile differences among files
git fetch <source> master
where source may be upstream or the location of someone else's directory
Next, use git status to figure out which files have conflicts
Within file that have conflicts you will find one or more sections flagged as follows
<<<<<<<< HEAD
Original version
=======
New version
>>>>>>>
You'll need to figure out whether you want to keep the original, the new version, or combine the code in some way. In doing so you'll definitely want to remove the '<<<<<<<', '=======', and '>>>>>>>' tags
Once these errors have been resolved you'll need to use git add to mark files as fixed
git add <fixed_file>
Finally, you can now commit these changes
git commit -m "fixed conflicts in merge"