Difference between revisions of "Using Git GUI"

From Geos-chem
Jump to: navigation, search
(Edit menu)
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
__FORCETOC__
 +
'''''[[Viewing the revision history|Previous]] | [[Branching|Next]] | [[Guide to using Git with GEOS-Chem]]'''''
 +
 +
#[[Introduction to Git]]
 +
#[[Installing Git]]
 +
#[[First-time Git setup]]
 +
#[[Cloning (i.e. downloading for the first time)]]
 +
#[[Ignoring files]]
 +
#[[Viewing the revision history]]
 +
#<span style="color:blue">'''Using Git GUI'''</span>
 +
#[[Branching]]
 +
#[[Committing]]
 +
#[[Tagging]]
 +
#[[Merging]]
 +
#[[Receiving updates (aka pulling)]]
 +
#[[Using patches to share your updates with others]]
 +
#[[Advanced Git usage]]
 +
#[[Git and Github tutorials]]
 +
 +
 
== Overview ==
 
== Overview ==
 
On this page, we provide information about using the Git GUI interface.
 
On this page, we provide information about using the Git GUI interface.
Line 4: Line 24:
 
== The Git Graphical User Interface (GUI) ==
 
== The Git Graphical User Interface (GUI) ==
  
We recommend using the '''git gui''' for source code management.  Start this in your code directory:
+
We recommend using the '''git gui''' for source code management.   
 +
 
 +
(1) '''Start Git GUI:''
  
      git gui &
+
git gui &
  
This will open up a window that looks like this:
+
(2) The Git GUI screen will appear:
  
 
[[Image:GitGui.png]]
 
[[Image:GitGui.png]]
  
On the left there are 2 windows:
+
(3) On the left you will see two windows:
  
#'''Unstaged Changes:''' An unstaged change is a modification that Git does not know about yet.  If you modified any files since the last commit, then they should be displayed in this window.  Also, right above this window you will find the name of the current checked-out branch.
+
#'''Unstaged Changes''' (@ top-left): An unstaged change is a modification that Git does not know about yet.  If you modified any files since the last commit, then they should be displayed in this window.  Also, right above this window you will find the name of the current checked-out branch.
#'''Staged Changes:''' These are changes that Git will add to the repository the very next time you make a commit.
+
#'''Staged Changes''' (@ bottom-left): These are changes that Git will add to the repository the very next time you [[Commmitting|make a commit]].
 
+
In general, anytime you need to modify the source code, you should NOT do it on the '''master''' branch.  You should [[#Creating branches|create a new branch]] for your modifications.  Then you can test your modifications ad nauseum until you are sure that everything is functioning as it should.  When your modifications are complete, you can [[#merging|merge your branch]] into the '''master''' branch. You can then [[#Deleting branches|delete the branch]] you created. 
+
 
+
The advantage of this approach is that if you ever need to start over from scratch, you can just go back to the '''master''' branch and you will get back the state of the code before your modifications were added.
+
  
 
== Git Gui menus ==
 
== Git Gui menus ==
Line 37: Line 55:
  
 
#The Undo, Redo, Cut, Copy, Paste, Delete, and Select All menu items are self-explanatory.
 
#The Undo, Redo, Cut, Copy, Paste, Delete, and Select All menu items are self-explanatory.
#Options: will open a dialog box where you can customize the look and feel of the Git Gui (set colors, fonts, etc.)
+
#Options: will open a dialog box where you can customize the look and feel of the Git Gui (i.e. set colors, fonts, etc.)
  
 
=== Branch menu ===
 
=== Branch menu ===
Line 77: Line 95:
  
 
You typically will not use these commands, unless you have write-access to the remote repository.
 
You typically will not use these commands, unless you have write-access to the remote repository.
 +
 +
== Further reading ==
 +
 +
#[https://git-scm.com/book/en/v2/Appendix-A%3A-Git-in-Other-Environments-Graphical-Interfaces ''Graphical interfaces'' (Git documentation)]
 +
 +
 +
----
 +
'''''[[Viewing the revision history|Previous]] | [[Branching|Next]] | [[Guide to using Git with GEOS-Chem]]'''''

Latest revision as of 20:27, 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


Overview

On this page, we provide information about using the Git GUI interface.

The Git Graphical User Interface (GUI)

We recommend using the git gui for source code management.

(1) 'Start Git GUI:

git gui &

(2) The Git GUI screen will appear:

GitGui.png

(3) On the left you will see two windows:

  1. Unstaged Changes (@ top-left): An unstaged change is a modification that Git does not know about yet. If you modified any files since the last commit, then they should be displayed in this window. Also, right above this window you will find the name of the current checked-out branch.
  2. Staged Changes (@ bottom-left): These are changes that Git will add to the repository the very next time you make a commit.

Git Gui menus

Repository menu

GitGuiRepoMenu.png

The most important of these commands are:

  1. Visualize all branch history: This will open the Gitk browser so that you can view the revision history.
  2. Compress database: You can pack the database to reduce storage size.

Edit menu

GitGuiEditMenu.png

  1. The Undo, Redo, Cut, Copy, Paste, Delete, and Select All menu items are self-explanatory.
  2. Options: will open a dialog box where you can customize the look and feel of the Git Gui (i.e. set colors, fonts, etc.)

Branch menu

GitGuiBranchMenu.png

This menu is pretty self-explanatory. You can choose to:

  1. Create a new branch
  2. Checkout an existing branch
  3. Rename a branch
  4. Delete a branch
  5. Reset a branch (i.e. ignore commits newer than the present commit)

More information about branching is covered in on the Branching page.

Commit menu

GitGuiCommitMenu.png

This menu contains options for committing code into the repository. However, the most important of these are:

  1. Sign off: Allows you to add your signature to the commit message (which you type in the lower right-hand window).
  2. Commit: Commits the staged files (in the lower-left hand window) into the repository.

Also note that both Sign Off and Commit have buttons at the front of the GUI (which you will probably use more often).

Merge menu

GitGuiMergeMenu.png

The most important command is:

  1. Local merge: This will pop open a dialog box and ask you which branch in your local code folder that you would like to merge into the current branch.

Remote menu

GitGuiRemoteMenu.png

You typically will not use these commands, unless you have write-access to the remote repository.

Further reading

  1. Graphical interfaces (Git documentation)



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