Page History
...
Once the code is cleaned up and we have less repositories we will move the code to the slac-lcls organization. This organization will also be used by the DAQ group and allows to group all of your code development together.
GitHub account
If you do not already have a GitHub account, sign up for a new account on GitHub.
Setup git
The following steps describe how to setup git. This setup has to done only once for the machine where you are planing to develop code.
Setting the user name in git:
Code Block | ||||
---|---|---|---|---|
| ||||
git config --global user.name "my name" |
Setting the email address in git:
Code Block | ||||
---|---|---|---|---|
| ||||
git config --global user.email "my email"
|
...
Confirm
...
that
...
your
...
user
...
name
...
is
...
correct
...
by:
Code Block | ||||
---|---|---|---|---|
| ||||
git config --global user.name |
...
Code Block | ||||
---|---|---|---|---|
| ||||
git config --global user.email |
Setup ssh keys for your GitHub account
To make the development more convenient it is recommended to setup ssh keys for your GitHub account.
Detailed instructions can be found here:
account
If you do not already have a GitHub account, sign up for a new account on GitHub.
Setup ssh keys for your GitHub account
https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/
...
Adding ssh keys can be done in the settings of your GitHub account (top right button on GitHub) and in the settings menu there is a "SSH and PGP keys" section.
Check if you already have an ssh key by checking if the following file exists: ~/.ssh/id_rsa.pub
If yes, create a new ssh key on GitHub and copy the content of ~/.ssh/id_rsa.pub to the Key section.
if you don't already have a ssh key, create a new one with the following command
Code Block | ||||
---|---|---|---|---|
| ||||
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
|
Afterwards create a new ssh key on GitHub and copy the content of ~/.ssh/id_rsa.pub to the Key section.
Useful Commands
Check status of the repo
Code Block | ||||
---|---|---|---|---|
| ||||
git status |
Show current and available branches in the repository
Code Block | ||||
---|---|---|---|---|
| ||||
git branch |
...
|
Show local changes in the code since the last commit
Code Block | ||||
---|---|---|---|---|
| ||||
git diff |
...
|
Git workflow
The following section describes the workflow for developing software with git.
...