Make a github user account and clone this repository https://github.com/CC-RMD-EpiBio/autoencirt.git
git clone https://github.com/CC-RMD-EpiBio/autoencirt.git
git fetch --all
Github guides in general are informative: https://guides.github.com/
- Basic Hello World with github https://guides.github.com/activities/hello-world/ (10 - 30 minutes)
- Understanding the github flow https://guides.github.com/introduction/flow/ (10 - 30 minutes)
- Making your code citable https://guides.github.com/activities/citable-code/
- Documenting projects https://guides.github.com/features/wikis/
-
git checkout -b <new branch>
-
Make some modifications
-
git add <you the files you want to stage>
-
Add a commit message
git commit
- If needed to reference an issue, write
Issue #<issue number>
on the bottom - If needed to close an issue, write
Fixes #<issue number>
on the bottom- close
- closes
- resolves
- resolved
- fixed
-
Squash commits
git rebase -i <hash or HEAD~2>
- Use
git log
to find the hash number HEAD~#
is the last number of commits- the UI is interactive and help guide you to squashing your commits
- Use
-
git fetch --all
Grab the master branch -
Attempt to merge the master branch
git merge upstream/master
- See Cherry Picking when you want your commits to exist on the end
-
git push
Push it to your git account- If it doesn't exist git will complain and print out a command to run
- The command is
git push --set-upstream origin <branch_name>
-
Make a pull request on github
Most open source projects encourage contributers to cherrypick because git place the commit on the end rather than somewhere in the middle. This project do not require cherry picking except for any changes which has a large impact on other users such as refactoring or merge conflicts with pr requests.
-
git checkout -b <new_dev_branch>
-
Make some modifications
-
git add <you the files you want to stage>
-
Add a commit message
git commit
- If needed to reference an issue, write
Issue #<issue number>
on the bottom - If needed to close an issue, write
Fixes #<issue number>
on the bottom- close
- closes
- resolves
- resolved
- fixed
-
Squash commits
git rebase -i <hash or HEAD~2>
- Use
git log
to find the hash number HEAD~#
is the last number of commits- the UI is interactive and help guide you to squashing your commits
- Use
-
git fetch --all
Grab the master branch -
git checkout upstream/master
Checkout the upstream master -
git checkout -b <cherry_pick>
Create a branch -
git log <new_dev_branch>
- You can run
git log --oneline <new_dev_branch>
for a more condensed log
git cherry-pick <hash>
- You can pick a range of commits with
git cherry-pick <hash_A>...<hash_B>
git push --set-upstream origin <cherry_pick>
- Make a pull request on github
First, rebase your commits
I would not recommend merging during development. These commands will clutter your commits with upstreams.
git checkout master
git fetch --all
git merge upstream/master
git push
git checkout master
git fetch --all
git checkout upstream/master
git checkout -b <up_branch>
git log <dev_branch> ## remember the commit hash
git cherry-pick <Hash>
git push --set-upstream origin <up_branch>
## Make a pull request
For maintainers
When two forks are in active development, git merge
may combine the commits in a sequential order between the two forks. In some cases, this merge will be harmless. In other cases, the files change randomly. The best solution is to cherry-pick one fork commits into the other fork.
- Choose a fork you want to merge into
- See the commits
*
git log --left-right --graph --cherry-pick --oneline fork1...fork2
- I choose fork one
- See the commits
*
- See fork2 commits only
git log --left-right --graph --cherry-pick --oneline fork1...fork2 | grep '>'
- Reverse
>
when you want to see only fork 1 commits
git checkout fork1
git checkout -b cherrypick-fork2
git cherry-pick <fork1-hash>
git cherry-pick <fork1-hash>
- ....
- ....
git cherry-pick <fork1-hash>
https://lwn.net/Articles/328436/
- Change branches
git checkout <branch name>
- View branch
git branch
- View all branches
git branch -a
- Delete branches
git branch -d <branch name>
- View log
git log
- View commit
git status
- Undo Staging
git reset