Skip to content

Latest commit

 

History

History
executable file
·
73 lines (49 loc) · 2.83 KB

github.md

File metadata and controls

executable file
·
73 lines (49 loc) · 2.83 KB

GitHub basic commands

The following is a list of useful GitHub commands. If your still confused after reading it don't hesitate to ping @PhilPalmer or @adeslatt. You can also read this this guide (10mins read) for a more comprehensive introduction to GitHub.

Download the repository from GitHub.com to your machine

As the repository is currently private you wil need to sign in to your GitHub account. (You can also chache your password or generate SSH keys to prevent needing to enter your username and password everytime you push or pull from GitHub).

git clone https://github.com/TheJacksonLaboratory/splicing-pipelines-nf.git

Change into the `repo` directory

cd splicing-pipelines-nf

To ensure you are up-to-date with the master branch or whatever branch you may be on

This command updates the local branch (line of development) with updates from its remote counterpart. Developers use this command if a teammate has made commits to a branch on a remote, and they would like to reflect those changes in their local environment.

git pull

To checkout on your own branch

Remember to not stay on a branch long, so your changes do not get too far out of sync with the master. A common convention for branch names is yourname-feature eg phil-docs-update

git checkout -b [name of your branch]

Once you are on your own branch you can then make changes, for example, edit README.md using the text editor

To show the status of changes

Changes are shown as either untracked, modified, or staged. It will also show you what branch you're on

git status

To add, commit and push your changes.

add

Stage the changed files eg git add README.md

git add [whatever you have added]

commit

This is like taking a snapshot of all of the files that have been added

git commit -m “a useful message regarding what you have changed”

push

Push changes to github

git push

git_cmds

To push your new local branch to GitHub

git push --set-upstream origin [name of your branch]

You can then open a pull request from your branch into master. This allows everyone to be able to see and review the changes you've made. Once you're happy with the changes (and ideally once the changes have been reviewed by at least one other person) you can then click merge to merge your changes into the master branch for everyone to use! 🎉