Git Workflow: Difference between revisions

From Littledamien Wiki
Jump to navigation Jump to search
(Created page with "Git Server set up on dbarchowsky.com. ==Configuration== * Physical origin repos located beneath <code>d:\shared\git</code> * To make a new project: <syntaxhighlight lang="do...")
 
Line 1: Line 1:
Git Server set up on dbarchowsky.com.
Git Server set up on dbarchowsky.com.
==Working with existing projects==
* Make sure the 'dev' drive is available on the current client:
<syntaxhighlight lang="dos">
subst m: "\\littledamienii\develop"
</syntaxhighlight>
Using 'Git Bash' navigate to the project directory.
<syntaxhighlight lang="bash">
$ cd /m/littledamien/littledamien_web
</syntaxhighlight>
* Make a new Git branch
<syntaxhighlight lang="bash">
$ git branch -b mynewbranch
</syntaxhighlight>
* Edit, add, and commit as usual
* When the update is complete, merge the branch with 'master'
* Then move the commits to the main repo:
<syntaxhighlight lang="bash">
$ git push ssh://[uname]@[domain].com:[port]/path/to/repo master
</syntaxhighlight>


==Configuration==
==Configuration==
Line 7: Line 30:
d:
d:
cd \shared\git
cd \shared\git
mkdir myprojectname
git clone ..\..\develop\path\to\project_root
cd myprojectname
cd .\path\to\project_root
git init
git init
rem <<< is that last 'git init' step necessary ??? >>>
</syntaxhighlight>
</syntaxhighlight>


* A symbolic link has been created between my user directory and the Git base directory
* At least for now, when fetching & pulling vial ssh, the root directory is the Git install directory (<code>C:\Git</code>).
:* A symbolic link has been created between <code>C:\Git</code> directory and the Git base directory (<code>D:\shared\git</code>)
<syntaxhighlight lang="dos">
<syntaxhighlight lang="dos">
cd ~
cd \Git
mklink /d "git" "d:\shared\git"
mklink /d "refs" "d:\shared\git"
symbolic link created for git <<===>> d:\shared\git
rem symbolic link created for refs <<===>> d:\shared\git
</syntaxhighlight>
</syntaxhighlight>


* The symbolic link allows access to the git repo via
:* The symbolic link allows access to the git repo via
<syntaxhighlight lang="bash">
<syntaxhighlight lang="dos">
$ git clone|push|pull|etc. ssh://username@server/git/path/to/myrepo
git clone|push|pull|etc. ssh://username@server/refs/path/to/myrepo
</syntaxhighlight>
</syntaxhighlight>




[[Category:GIT]]
[[Category:GIT]]

Revision as of 16:57, 9 May 2012

Git Server set up on dbarchowsky.com.

Working with existing projects

  • Make sure the 'dev' drive is available on the current client:
subst m: "\\littledamienii\develop"

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

  • 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