User Tools

Site Tools


noresm:gitbestpractice

This is an old revision of the document!


Obtain a copy of the model

Use the command

 git clone https://github.com/metno/noresm 

If you get error messages, verify that you can open the page https://github.com/metno/noresm in a web-browser. If you can not, you are probably not a github-user or not member of the noresm group on github. Send email to alf.grini@met.no (with a copy to trond.iversen@met.no) to get the right permissions. (You can create the github user yourself)

Verify that you have the correct checkout

Check that your favourite branch is available using the command <git branch –all>

To check out (locally) your favourite branch and to start working on it, write

git checkout -b myBranchName origin/myBranchName 

(Note that myBranchName must be one of the branches listed by the above command)

Modify files

Modify the code (for example a file named myChangedFile.F90) and send back to your local repository through

git add myCHangedFile.F90 
git commit -m "aMessage" 

Verify, using the tool “gitk” that the changes make sense.

Send modifications to github

This command assumes that your changes go to the remote branch named like your branch (which is most of the times the case)

git push 

You can also do (to be completely sure):

git push remoteName myLocalBranchName:remoteBranchName 

which if your are changing the master-branch would translate to

git push origin master:master 

(The above command means push my changes to the remote named “origin” from my local branch named master to the remote branch named master. If you are changing another branch than master, you must obviously not write “master”.

noresm/gitbestpractice.1447416932.txt.gz · Last modified: (external edit)