Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The first step is to clone the repository you want to contribute by using the flowing command:

Code Block
languagebash
themeEmacs
git clone git@github.com:lcls-psana/"the repository you want to clone".git

The repository where you clone from is typically called "upstream".  This is the global copy of the repository that all developers share and work on together.

Git clone creates a local copy of the repository in a new folder with the repository and any same name as the repository. Any changes that you do to the repository only effect your local copy until you push the changes upstream.

This step only has to be done onceAll git commands have to be issued from inside the directory of the git repository.

Make changes to the code

After cloning the repository make changes to the code

Adding new files to the git repo

git add "file"

Create new branch

git checkout -b "new branch"

Commit changes

If you created new file they can be added to git with the following command:

Code Block
languagebash
themeEmacs
git add "file"

Commit changes

After changing the code these changes have to be committed with:

Code Block
languagebash
themeEmacs
git commit -a -m "commit message"

 There are two different ways to commit changes in git: The first way is to automatically stage all files that git is tracking bash git commit -a -m "commit message" The other option is to specifically stage the files you want to commit bash git add "files that you changed" git commit -m "commit message"

If upstream is ahead of your local version bash git fetch origin git rebase -p origin

...