Git workflow for a single developer (total Git newbie)

I decided it was time for me to use Git in a PHP project that I had been developing for over ten years. (Please, no lectures from the police of version control!) Due to the complicated setup necessary for my VPS to do everything the project needs (especially a structure with one code and several clients and a Japanese installation of TeX to create special PDF files), I can configure the development environment in the local local box of Windows. But I have a test site on the server that I can play, so this is my area of ​​development. I am currently using Filezilla to access the server and open files directly in Notepad ++, and when I am ready to see my editing in action, I just save and release Filezilla. When everything looks good on a test bench,I copy files to the production codebase area. Yes, this does not give me any changes in my changes, except for my own comments, and I have to be careful not to mix bug fixes with half-completed new features. I see the value of Git branches for various updates.

Yesterday I got wet fingers. First I created a Github account, and then (as recommended by the tutorial) installed Git for Windows (with its own Bash and tiny GUI) and Kdiff3, and then followed some instructions for setting up Git Bash. However, after that I had to install something else to interact with my Github account (with the corresponding Github name for Windows), which seems to do everything the other two programs should have done for me. Anyway, I did a simple task as my first foray into the Github world - I added functionality to someone else jQuery plugin and wanted to share it with the developer, so I forked his repo, clonedit to my machine, overwriting the file that I previously edited and tested, synchronized in my Github account and sent a pull request . The whole terminology in this last sentence was completely new to me, so I was very proud of myself that I got this far .;) But I think I needed only Github software and not Git software - it’s hard to understand which tutorials to believe.

, , , . , , - , , Github , , ( , - oddball, , , ). , ? , - :

  • , Filezilla ( , , Filezilla , ). , , , Github (- - ) .

  • Linux- Git VPS, Git , Git PuTTY . ( ), Git:

    • PuTTY, - , .
    • , Linux Git , , , ( - , ).

    , Git, , , Git Github, .

  • , # 1, # 2 Git/Github , , , , , .

PHP № 2 ( PuTTY ), , , Github ( xAMP ). , , Github, , , - . Github, - - ( Github?), - ( ), Github, Git / , .

, - , ? ?

+5
3

:

:

  • . [1]
  • . , , ssh in to. [2]
  • . [3]

:

workstation$ cd localWorkingDirectory/
workstation$ git init
workstation$ git add .
workstation$ git commit -m 'initial commit'
workstation$ ssh login@myserver
myserver$ mkdir myrepo.git
myserver$ cd myrepo.git
myserver$ git init --bare
myserver$ exit
workstation$ cd localWorkingDirectory/
workstation$ git remote add origin login@myserver:myrepo.git
workstation$ git push origin master

, , :

workstation$ git push origin BRANCH

version2 :

workstation$ git push origin version2
workstation$ ssh login@myserver
myserver$ git clone path/to/myrepo.git productionDirectory
myserver$ cd productionDirectory
myserver$ git checkout version2

! ! 1!

workstation$ ssh login@myserver
myserver$ cd productionDirectory
myserver$ git checkout version1
+2

github ( ), git. , . Git - ( , , subversion). git init .

, . , , , . , . , , .

, . . script, . , , (Capistrano - ).

+1

- capistrano .

, , , , git . , , , capistrano, :

git commit -a 
git push origin develop
cap deploy:dev

When I work on windows, I usually try to replicate the deployment environment that I use with virtual machines locally using something like sun virtualbox. In this way, you can minimize potential environmental problems while developing locally. Then you can just use putty for ssh for your local vm. Sharing settings between vm and your host operating system and all standard IDEs / editors will work too. I find it preferable to configure vps remotely, but everything works.

0
source

All Articles