noresm:gitbestpractice

This is an old revision of the document!


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. Go to https://github.com/join and create a user. Make user-name which is easy to understand, for example FirstnameLastname. You can attach several email-addresses to the same user.

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 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.

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”.

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
  • noresm/gitbestpractice.1447417225.txt.gz
  • Last modified: 2022-05-31 09:23:24
  • (external edit)