Difference between revisions of "First-time Git setup"

From Geos-chem
Jump to: navigation, search
(Overview =)
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Overview ==
+
__FORCETOC__
 +
'''''[[Installing Git|Previous]] | [[Cloning (i.e. downloading for the first time)|Next]] | [[Guide to using Git with GEOS-Chem]]'''''
  
Before using Git for the first time, you need to set up your <tt>~/.gitconfig</tt> file. This will set some global parameters, such as your name and email, and the external editor that you wish to use with Git.
+
#[[Introduction to Git]]
 +
#[[Installing Git]]
 +
#<span style="color:blue">'''First-time Git setup'''</span>
 +
#[[Cloning (i.e. downloading for the first time)]]
 +
#[[Ignoring files]]
 +
#[[Viewing the revision history]]
 +
#[[Using Git GUI]]
 +
#[[Branching]]
 +
#[[Committing]]
 +
#[[Tagging]]
 +
#[[Merging]]
 +
#[[Receiving updates (aka pulling)]]
 +
#[[Using patches to share your updates with others]]
 +
#[[Advanced Git usage]]
 +
#[[Git and Github tutorials]]
  
Once you have defined your <tt>~/.gitconfig</tt> file, you can copy it any other computer systems where you use Git.  That will ensure that you have the same identity and settings across all systems.
+
 
 +
== Define global Git settings ==
 +
 
 +
Before using Git for the first time, you need to set up your <tt>~/.gitconfig</tt> file.  This will set some global parameters, such as your name and email, and the external editor that you wish to use with Git.  Once you have defined your <tt>~/.gitconfig</tt> file, you can copy it any other computer systems where you use Git.  That will ensure that you have the same identity and settings across all systems.
  
 
=== By editing the .gitconfig file ===
 
=== By editing the .gitconfig file ===
Line 30: Line 48:
 
== Further reading ==
 
== Further reading ==
  
 +
#[https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup ''First-time Git setup'' (Official Git documentation)]
 
#[https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration ''Git configuration'' (Official Git documentation)]
 
#[https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration ''Git configuration'' (Official Git documentation)]
 
#[https://docs.scipy.org/doc/numpy-1.6.0/dev/gitwash/configure_git.html ''Git configuration'' (Numpy documentation)]
 
#[https://docs.scipy.org/doc/numpy-1.6.0/dev/gitwash/configure_git.html ''Git configuration'' (Numpy documentation)]
 +
 +
 +
----
 +
'''''[[Installing Git|Previous]] | [[Cloning (i.e. downloading for the first time)|Next]] | [[Guide to using Git with GEOS-Chem]]'''''

Latest revision as of 20:20, 5 August 2019

Previous | Next | Guide to using Git with GEOS-Chem

  1. Introduction to Git
  2. Installing Git
  3. First-time Git setup
  4. Cloning (i.e. downloading for the first time)
  5. Ignoring files
  6. Viewing the revision history
  7. Using Git GUI
  8. Branching
  9. Committing
  10. Tagging
  11. Merging
  12. Receiving updates (aka pulling)
  13. Using patches to share your updates with others
  14. Advanced Git usage
  15. Git and Github tutorials


Define global Git settings

Before using Git for the first time, you need to set up your ~/.gitconfig file. This will set some global parameters, such as your name and email, and the external editor that you wish to use with Git. Once you have defined your ~/.gitconfig file, you can copy it any other computer systems where you use Git. That will ensure that you have the same identity and settings across all systems.

By editing the .gitconfig file

Open a text editor and then cut & paste the text from this sample .gitconfig file.

[user]
        name = Your Name
        email = you@yourdomain.example.com
 
[core]
        editor = emacs

There are other settings you can add, but these are the absolute minimum that you need. Be sure to change your name and email accordingly, this is how Git will know who you are!

When you are done editing the file, save it as ~/.gitconfig.

Or by using the git config command

If you do not wish to manually edit the the ~/.gitconfig file, you can define the same settings by using the git config --global command:

git config --global user.name "Your Name"
git config --global user.email you@yourdomain.example.com
git config --global core.editor emacs

Further reading

  1. First-time Git setup (Official Git documentation)
  2. Git configuration (Official Git documentation)
  3. Git configuration (Numpy documentation)



Previous | Next | Guide to using Git with GEOS-Chem