Git

From GLMWiki
Revision as of 13:52, 15 July 2014 by Laury (Talk | contribs)

Jump to: navigation, search
Git

Git Docs

Git Pro Book

Git Tutorial

Git Flow Workflow

Install

Installing Git

Git for the first time

Setting up Git for the first time

Git Ignore File

create a file called .gitignore_global in you home directory

# 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

SSH Keys

Creating your ssh keys (private/public)

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

How to sign your commit or tags

Reference

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

Git Flow Process (example)

This is merely an example. Things may not always follow this line of commands exactly.

(0. ssh-add)

1. git clone git@cvs2:web/mywebsite.git www.mywebsite.com (like SVN checkout)

2. cd www.mywebsite.com

3. git flow init (master, develop, feature, release, hotfix, support, V (only change from default))

4. git branch -av (shows what branch you are on, as well as the branches that exist both locally and remotely)

5. git checkout develop (unnecessary, but UNLIKE SVN this merely changes the branch you're currently on to Develop)

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