Difference between revisions of "Git"

From GLMWiki
Jump to: navigation, search
(Git Flow Process (example))
 
(60 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[Image:Git-Logo-2Color.png|center|thumb|Git]]
+
[[Image:Git-Icon.png|center|Git]]
 +
==GLM Git Guide==
 +
[[The Great GLM Git Guide]]
 +
 
 
==Git Docs==
 
==Git Docs==
 +
[http://try.github.com/ Try git tutorial]
 +
 
[http://git-scm.com/book Git Pro Book]
 
[http://git-scm.com/book Git Pro Book]
  
Line 7: Line 12:
 
[http://www.atlassian.com/git/workflows#!workflow-gitflow Git Flow Workflow]
 
[http://www.atlassian.com/git/workflows#!workflow-gitflow Git Flow Workflow]
  
==Install==
+
[http://www.atlassian.com/git/tutorial/remote-repositories#!pull git pull --rebase]
[[Installing Git]]
+
  
==Git for the first time==
+
==Installation & Initial Setup==
[[Setting up Git for the first time]]
+
[[Git Installation & Initial Setup]]
  
== Git Ignore File ==
+
==Setup ssh-agent==
create a file called .gitignore_global in you home directory
+
[[ssh-agent on windows(git bash)]]
<pre>
+
# OS generated files #
+
######################
+
.DS_Store*
+
ehthumbs.db
+
Icon?
+
Thumbs.db
+
._*
+
*.swp
+
 
+
# Gaslight Media Application specific #
+
# files that are updated on server    #
+
#######################################
+
iconCache/
+
uploads/
+
cache/
+
compiled/
+
compile/
+
original/
+
resized/
+
midsized/
+
thumb/
+
thumbs/
+
ht_images/
+
photo-large/
+
photo-small/
+
prototype/
+
weather-feed.xml
+
php.error
+
reports/
+
editimagesworkwith/
+
editimagesoriginal/
+
editedImages/
+
editimagespng/
+
.buildpath
+
.settings
+
.project
+
.svn
+
nbproject
+
</pre>
+
 
+
==SSH Keys==
+
[[Creating your ssh keys (private/public)]]
+
  
 
==Git-Svn==
 
==Git-Svn==
Line 65: Line 26:
  
 
==Gitolite==
 
==Gitolite==
[[Creating a new Git repo]]
+
[[The Great GLM Git Guide#Creating a new Git repo|Creating a new Git repo]]
  
 
==gpg signing==
 
==gpg signing==
[[How to sign your commit or tags]]
+
If you’re making signed annotated tags (as discussed in Chapter 2 of Git Pro), setting your GPG signing key as a configuration setting makes things easier. Set your key ID like so:
  
==Reference==
+
git config --global user.signingkey <gpg-key-id>
git book online
+
http://git-scm.com/book
+
  
==Git Flow Process (example)==
+
==Git New Website Setup Checklist==
This is merely an example. Things may not always follow this line of commands exactly.
+
[[The Great GLM Git Guide#Git New Website Setup Checklist|Git New Website Setup Checklist]]
  
(0. ssh-add)
+
== Git Flow ==
 +
[[The Great GLM Git Guide#Git Flow|Git Flow]]
  
1. '''git clone git@cvs2:web/mywebsite.git www.mywebsite.com''' (like SVN checkout)
+
== Git home config file ==
 +
[[The_Great_GLM_Git_Guide#Git_home_config_file| Git home config file]]
  
2. '''cd www.mywebsite.com'''
+
== Git Ignore File ==
 +
[[The_Great_GLM_Git_Guide#Git_ignore_file|Git Ignore File Setup]]
  
3. '''git flow init''' (master, develop, feature, release, hotfix, support, V (only change from default))
+
==SSH Keys==
 +
[[Creating your ssh keys (private/public)]]
  
4. '''git branch -av'''  (shows what branch you are on, as well as the branches that exist both locally and remotely)
+
==Reference==
 
+
git book online
5. '''git checkout develo'''p (unnecessary, but UNLIKE SVN this merely changes the branch you're currently on to ''Develop'')
+
http://git-scm.com/book
 
+
6. '''git flow hotfix start 1.0.3''' (this creates the hotfix branch called 1.0.3)
+
 
+
(*. or: '''git flow feature start AwesomeFeature''')
+
 
+
-- start up your favorite editor and make whatever changes to whichever project/files you please --
+
 
+
7. '''git status''' (will show you all changed files)
+
 
+
8. '''git add''' . (will make all files in all folders in the current directory ready for committing)
+
 
+
(*. or to add a single file: ''git add .htaccess'')
+
 
+
9. '''git commit''' (will commit changes to the main branch)
+
 
+
(*. oops! Forgot a change/file? It's not too late to add: '''git commit --amend''' )
+
 
+
10. liberal use of '''git status'''. This will also show the command '''git reset HEAD -- .gitignore.whatever''' to remove something you '''git add'''-ed (also works on folders)
+
 
+
11. '''git flow hotfix finish '1.0.3'''' (this will bring you back to the develop branch and delete the hotfix branch after it merges its changes. Make note of your edits!)
+
(*. '''git flow feature publish someFeature''' is another example, though '''publish''' doesn't remove the branch, it merely does the merge)
+
(*. Git may at some point complain about the fact that there are changes to wherever you're trying to commit/push to. It's merely a matter of doing '''git pull origin develop''' (to pull all changes from Origin to Develop) so that you're up-to-date!)
+
 
+
10. '''git branch -av''' (to make sure you're on the branch you're meant to be)
+
 
+
11. '''git push origin develop''' (send changes to the remote main branch - TO origin FROM develop)
+
 
+
(*. '''git push --all''' is an alternative though it may be safer to be precise. This must be followed by '''git push --tags''')
+
 
+
12. '''gitk''' to marvel at a graphical representation of the good you've done today
+
 
+
13. '''ssh ws6''' (or dev53 or whatever server), then '''cd /var/www/server/www.myweb~'''
+
 
+
14. '''git pull origin develop'''
+

Latest revision as of 10:26, 9 June 2016

Git

GLM Git Guide

The Great GLM Git Guide

Git Docs

Try git tutorial

Git Pro Book

Git Tutorial

Git Flow Workflow

git pull --rebase

Installation & Initial Setup

Git Installation & Initial Setup

Setup ssh-agent

ssh-agent on windows(git bash)

Git-Svn

Checking out a site from svn with git (limit git) git svn http://git-scm.com/book/ch8-1.html

Gitolite

Creating a new Git repo

gpg signing

If you’re making signed annotated tags (as discussed in Chapter 2 of Git Pro), setting your GPG signing key as a configuration setting makes things easier. Set your key ID like so:

git config --global user.signingkey <gpg-key-id>

Git New Website Setup Checklist

Git New Website Setup Checklist

Git Flow

Git Flow

Git home config file

Git home config file

Git Ignore File

Git Ignore File Setup

SSH Keys

Creating your ssh keys (private/public)

Reference

git book online http://git-scm.com/book