Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
noresm:gitbestpractice [2015-11-17 08:17:31] alfg |
noresm:gitbestpractice [2022-05-31 09:29:32] (current) |
||
---|---|---|---|
Line 2: | Line 2: | ||
- | - Visit this page: https:// | ||
- **Create a github user:** You can create the github user yourself. Go to https:// | - **Create a github user:** You can create the github user yourself. Go to https:// | ||
- | - Send email to alf.grini@met.no (with a copy to trond.iversen@met.no) to get the right permissions for the new github user (The email must contain who you are and the github username). | + | |
+ | | ||
- When you have the right permissions, | - When you have the right permissions, | ||
- git clone https:// | - git clone https:// | ||
- | If you get error messages, verify that you can open the page https:// | + | The last point will create a new directory called " |
- | **More advanced:** To make life easier and avoid typing passwords all the time when contacting the remote (i.e. github), follow | + | If you get error messages, verify that you can open the page https:// |
+ | |||
+ | **Also do the following on all machines | ||
+ | * **Make sure you have a version of git >= 2.0** (add the line " | ||
+ | * **git config - -global push.default simple** (Will edit your ~/ | ||
Note that with git, the main branch is no longer called " | Note that with git, the main branch is no longer called " | ||
Line 31: | Line 35: | ||
Note that once a branch has been checked out using the -b option, you can switch between any of your checked out branches using the command | Note that once a branch has been checked out using the -b option, you can switch between any of your checked out branches using the command | ||
< | < | ||
+ | |||
+ | Note that in git, switching to a new branch change the files in your working directory. Git will warn you if you have any modified files before switching to a new branch. This is different from how svn works. | ||
====Modify files ==== | ====Modify files ==== | ||
Modify the code (for example a file named myChangedFile.F90) and send back to your local repository through | Modify the code (for example a file named myChangedFile.F90) and send back to your local repository through | ||
- | < | + | < |
< | < | ||
- | The message should link to the issue on github, so if you fix issue number 100 by this code change, you would probably write something like < | + | The message should link to the issue on github, so if you fix issue number 100 by this code change, you would probably write something like < |
Verify, using the tool " | Verify, using the tool " | ||
Line 56: | Line 62: | ||
You can also do (to be completely sure): | You can also do (to be completely sure): | ||
- | < | + | < |
====If you don't understand and want to get back to svn ==== | ====If you don't understand and want to get back to svn ==== |