github reminders
- Clone the repository:
git clone https://github.rpi.edu/DataINCITE/AlzheimersDS.git
- Cd into
AlzheimersDS.git
- Check your current branch:
git branch
- The current branch should have an asterisk next to it
main is the default branch; we don’t recommend committing changes to main!
- Create a new branch:
git checkout -b new-branch-name
- Add edited (or new) files to branch:
git add thefilename.ext
- Example:
git add mynotebook.* (stages all files with the prefix mynotebook)
- Commit branch:
git commit -m "commit message"
- Push branch to origin:
git push origin my-branch-name
- Freshen local branch with updates from remote:
git pull origin main (NOTE: main now replaces master)
github notes
- Note that
git pull applies the remote updates only to the branch you are currently working in.
- Sometimes
git tells you it cannot complete your pull due to remote changes, and suggests you do a git stash and try again.
- We strongly recommend that you create a new branches for each new feature (e.g. piece of work)
- Try not to re-use the same branch for long periods of time
- A best practice is to associate branches with issues.