Git Workflow: Difference between revisions

From Littledamien Wiki
Jump to navigation Jump to search
No edit summary
Line 27: Line 27:


==Working with existing projects==
==Working with existing projects==
* Make sure the 'dev' drive is available on the current client:
* Make sure the 'dev' drive is available on the current client. See [[#Configuration|Configuration]]
<syntaxhighlight lang="dos">
subst m: "\\littledamienii\develop"
</syntaxhighlight>


Using 'Git Bash' navigate to the project directory.  
Using 'Git Bash' navigate to the project directory.  
Line 50: Line 47:


==Configuration==
==Configuration==
* Make sure the 'dev' drive is available while working with Git Bash on the current client.
<syntaxhighlight lang="dos">
subst m: "\\littledamienii\develop"
subst n: "\\littledamienii\shared"
</syntaxhighlight>
* Physical origin repos located beneath <code>d:\shared\git</code>
* Physical origin repos located beneath <code>d:\shared\git</code>
* To make a new project:  
* To make a new project:  

Revision as of 19:37, 11 May 2012

Overview

Git Server set up on dbarchowsky.com.

Creating a new repo out of an existing site

  • Navigate to the site's root directory.
  • Create a Git repository.
$ git init
  • Make a .gitignore file (images, wordpress install files, etc.)
  • Set username and email (necessary for each repo)
$ git config --global user.name "Damien Barchowsky"
$ git config --global user.email "dbarchowsky@gmail.com"
  • Add existing files to Git repo, confirm the list of files, and commit the changes.
$ git add .
$ git status -s
$ git commit -m "Initial version"
  • Clone the repo to 'origin'
$ cd /n/git/base_dir
$ git clone /m/base_dir/repo_dir

Working with existing projects

  • Make sure the 'dev' drive is available on the current client. See Configuration

Using 'Git Bash' navigate to the project directory.

$ cd /m/littledamien/littledamien_web
  • Make a new Git branch
$ git branch -b mynewbranch
  • Edit, add, and commit as usual
  • When the update is complete, merge the branch with 'master'
  • Then move the commits to the main repo:
$ git push ssh://[uname]@[domain].com:[port]/path/to/repo master

Configuration

  • Make sure the 'dev' drive is available while working with Git Bash on the current client.
subst m: "\\littledamienii\develop"
subst n: "\\littledamienii\shared"
  • Physical origin repos located beneath d:\shared\git
  • To make a new project:
d:
cd \shared\git
git clone ..\..\develop\path\to\project_root
cd .\path\to\project_root
git init 
rem <<< is that last 'git init' step necessary ??? >>>
  • At least for now, when fetching & pulling vial ssh, the root directory is the Git install directory (C:\Git).
  • A symbolic link has been created between C:\Git directory and the Git base directory (D:\shared\git)
cd \Git
mklink /d "refs" "d:\shared\git"
rem symbolic link created for refs <<===>> d:\shared\git
  • The symbolic link allows access to the git repo via
git clone|push|pull|etc. ssh://username@server/refs/path/to/myrepo