svn - Getting Started with Subversion, Git, or similar Version Control System to keep a History of my Files?

Closed. This question is off-topic. It is not currently accepting answers.Want to improve this question? Update the ques

Closed. This question is off-topic. It is not currently accepting answers.

Want to improve this question? Update the question so it's on-topic for WordPress Development Stack Exchange.

Closed 12 years ago.

Improve this question

I realize this may be a broad question on the surface, but I'm looking for specific examples of setups/workflows that people use to keep a version history of edited files on a WordPress site. For instance, when developing a site (and even after it's live), I often make changes to CSS and PHP files, but I don't have a great way of reverting to older versions of those files. For my purposes, making changes on a local development installation and then copying those changes over to the live site is often more trouble than I'd like. Any suggestions on how to get started using a versioning tool to track edits to files on a live site?

Closed. This question is off-topic. It is not currently accepting answers.

Want to improve this question? Update the question so it's on-topic for WordPress Development Stack Exchange.

Closed 12 years ago.

Improve this question

I realize this may be a broad question on the surface, but I'm looking for specific examples of setups/workflows that people use to keep a version history of edited files on a WordPress site. For instance, when developing a site (and even after it's live), I often make changes to CSS and PHP files, but I don't have a great way of reverting to older versions of those files. For my purposes, making changes on a local development installation and then copying those changes over to the live site is often more trouble than I'd like. Any suggestions on how to get started using a versioning tool to track edits to files on a live site?

Share Improve this question edited Aug 23, 2010 at 5:08 MikeSchinkel 37.6k14 gold badges117 silver badges132 bronze badges asked Aug 12, 2010 at 15:30 Travis NorthcuttTravis Northcutt 3,4005 gold badges43 silver badges60 bronze badges 2
  • 1 Just curious, Mike - why the title edits? In my mind, question titles should follow the rules of proper grammar. Maybe that's a good discussion for meta... – Travis Northcutt Commented Aug 23, 2010 at 5:42
  • You're already part of the discussion on meta, tnorthcutt. :) – user66 Commented Aug 23, 2010 at 13:24
Add a comment  | 

7 Answers 7

Reset to default 14

I am not sure how much you know about using version control, but I recently switched from SVN to Git and find that to be great!

Though it depends in you live site's server has Git installed (or will let you). I have a Git setup on the live server also, running off a branch called something like production. Whenever I finish implementing/fixing something locally, I merge it into the production branch, then SSH into the live site's server and pull in the changes. Beats dragging files over FTP when you never know if you are overwriting changes etc.

I would recommend putting some time in getting acquainted with Git (if you haven't already), I find it much easier and less hassle than SVN when it comes to changing/adding loads of files (and unlike SVN it doesn't put stupid .svn folders everywhere).

I am on a Mac, so sorry if none of these applies, but I use Coda as a code editor and installed Git through Ports (using Porticus).

If I were to set everything up anew, I would do:

  1. Install Coda

  2. Install Porticus (which will require you to install Ports, but there is information on that page)

  3. Once you have installed Porticus, open it open, search for "git-core" and Install that.

  4. Download and Install GitX 7-5

  5. There is a good guide on setting up a git repo here, but at it's basic: 1. Open Terminal. 2. cd to where you want your site to reside. $: mkdir mysite && cd mysite 3. $: git init and thats it! If you add files to this folder then continue to the next step

  6. Once you have set up a GIT repository locally (above article) then if you open that directory in GitX you will be able to commit stuff etc etc.

Setting it all up on the server can be a bit tricky, I have a MediaTemple and a Dreamhost account which both have GIT out of the box. The link in step 5 tells you how to add a remote repo, so you don't have to do that until you want to bring your live site into the equation. I would recommend getting everything working locally first (unlike SVN, GIT doesn't require a remote repository, so you can do everything on your machine for the time being).

I use SVN for version control with everything I do in WordPress development. I actually started this way because I needed SVN for plug-in development ... once I got started there, it was a natural extension to continue using SVN for themes and custom scripts on client sites.

Plug-ins

Since plug-ins are already hosted on WordPress' server, I just check out a plug-in directly to the /wp-content/plugins/ directory of my local WordPress installation (I run WAMP on my development box). Then I make changes to my local copy and, when it's ready for showtime, commit to the repository. It's a smooth process there, no uploading/downloading and instant verification that my changes worked.

Themes

Themes are a bit different, particularly when building for a client. I create a local repository (I have an R partition on my hard drive specifically for this purpose) and check out the empty repository directly to my /wp-content/themes directory. Then I make changes as needed and develop until it's ready, committing revisions as I go.

When I'm ready to publish the theme to a client's production server, I export the repository, zip it, and use the native Themes >> Add New functionality within WordPress. This works with custom plug-ins (that aren't hosted by WordPress) as well.

Tools

Like I said, I use WAMP on my local machine to run a development installation of WordPress. It works perfectly on my box and allows me to run as many instances of WordPress as I need for a particular project.

For SVN, I use Tortoise SVN. It's free, remarkably easy to use, and integrates with the file and command structure of Windows. Updating, committing, and exporting are all simple right-click, select command operations. Using "Export" allows you to send the entire folder (without the annoying .svn folders) directly to any location of your choice - I frequently export to the desktop. Zipping the folder is also a right-click operation, and WordPress handles the upload.

Manually transferring files can be a hassle, particularly if you keep changing one file but not all of them. If you instead FTP over the entire directory with "overwrite all" selected, it's much easier to replace old files (and you don't have to keep track of which changed and which didn't). It's like the old 5-minute installation WordPress used to have - just replace everything with the new version.

Personally, I think it is a fun exercise to install SVN / GIT and manage it, but if you can swing $15 per month, Beanstalk is worth every penny. They manage the whole server for you. http://beanstalkapp/ The FTP deployment tools are awesome. Mine automatically deploys the version to my staging server when I commit for example

Another way to get some personal file versioning is to use drop box. Every time you save a file into your dropbox it tracks the version, and you can restore to any previous version later on.. You and another developer, or group can share a drop box folder. Granted this does not do trunks, merges, etc, but it does make it very easy for a distributed team to work on one website. You just can not really work on the exact same files at once.

We keep our SVN working copy in dropbox, then I commit the files when the time is write. My designers will not commit files or deal with SVN, So this is the comprimise.

I prefer SVN because I do not need all the trunking that GIT is so great for and there are better GUI tools available of SVN.

I like Aptana a lot, its has subversion integrated in and you can connect to your server with ftp/sftp easily and push files up, another great feature that it has is that if you create a new php project and include the "entire" WordPress folder (with wp-admin, wp-includes) you get code completion in your theme files.

In my setup the repo is local.

You ask for "but I'm looking for specific examples of setups/workflows that people use to keep a version history of edited files on a WordPress site" but you also mention products :)

You get above as answer a list of tools and some best practices but I will focus here on the workflows: THEY ARE NOT WORDPRESS SPECIFIC:

But for the general examples/setups/workflows:

For starters: there ARE CM patterns, so independent of tooling. Google on CM Patterns, a lot of books out there, wiki's even communities e.g. http://www.cmcrossroads/forums.

There are also guides on setting up a valid stream strategy (google stream strategy), etc...

I don't think there is anything special about WordPress deployments compared to CM Management incl distributed parallel development on large Siebel, SAP, Informatica, Java etc.. factories. It's really almost default.

What is missing, I think, is that noone has writing a CMplan for WordPress development (yet) (IEEE). Once someone has done that (tool independent). The requirements can be filled in, I think, with any tool.

I think the reason that plan has not been written is that almost all WordPress implementations are still done by 1 person with a simple development-production setup so not with multiple developers/designers in the build phase having to deploy different versions that are running in the test environment, for instance.

the CMP plan starts with identifying all CI's in other words: make a list of all types of CI's present in a WordPress implementation including the apps, plugins, database, documentation, help, content, config files, release notes (!), etc...). That is a good start. Then decide which ones you want to bring under CM.

Next decide on what causes changes on these CI's e.g. a customer call for a bugfix, or an upgrade that is needed. If done right, this leads to a situation where you have the feeling things are under control.

Decisions like merging back from production to development and the way to handle that is part of that chapter (2 main patterns here) (though ofcourse you should try to minimize these hotfixes).

Only later look for a tool to do CM on one side (which includes version management as one of the tools) and change management tooling on the other side (which keeps you sane).

I think that is the best workflow to start with since, as far as I googled, noone has done yet. I think once the first person has written a WordPress CM Plan (according to IEEE) every other WordPress person in the world can copy that plan and make adjustments and implement the patterns in their tooling.

Isn't that too much work/too heavy : depends if you have a company or not: it can save your ass big time one day to have good CM plan.

I am on a shared host so I can't install SVN or anything like that. I use Mercurial to version-control on my home machine. I use Beyond Compare's FTP-sync to keep the local and remote folders in sync.

i'm using git. it's simple. you nly have to understand simple command such as clone, comit, push, pull and you're ready to go. that's the basic.

eventhough, if you use git it more such as coordinate a team to work on a products, then it's another level. but in the end, it worthed to use git or any version control. there're realiable when shit happen.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745204304a4616512.html

相关推荐

  • 计算机开机长鸣报警,电脑开机报警,详细教您电脑开机一直长鸣报警怎么办

    朋友们在使用电脑的过程中,经常会碰到开机一声长鸣,然后一直响个不停,这到底是怎么回事呢? 其实这个现象的产生一般是因为内存的问题,那用户遇到电脑开机一直

    1小时前
    00
  • UMIT:统一多模态多任务视觉

    随着深度学习的迅速发展,尤其是在医学影像分析领域的应用,越来越多的视觉-语言模型(VLMs)被广泛应用于解决复杂的健康和生物医学挑战。然而,现有研究主要集中在特定任务或单一模态上,这限制了它们在多种医学场景中的适用性和泛化能力。为了解决这

    1小时前
    00
  • 电脑密码在哪里设置win11,win11电脑开机密码怎么设置

    Win11系统由于许多设置和以前系统不一样了,所以很多用户们操作非常不习惯,有很多的小伙伴不知道win11系统怎么设置开机密码。给电脑设置密码,只有自己能打开进入系统桌面&a

    1小时前
    00
  • 初始JESD204B高速接口协议(JESD204B一)

    01、对比LVDS与JESD204JESD204B是逻辑器件和高速ADCDAC通信的一个串行接口协议,在此之前,ADCDAC与逻辑器件交互的接口大致分为如下几种。低速串行接口(I2C、SPI)、低速并行接口(包含时钟信号和并行数据信号,

    1小时前
    00
  • 面试官:从三万英尺角度谈一下Ceph架构设计(1)

    把面试官当陪练,在找工作中才会越战越勇大家好我是小义同学,这是大厂面试拆解——项目实战系列的第3篇文章,如果有误,请指正。本文主要解决的一个问题,Ceph为例子 如何描述项目的架构。一句话描述:主要矛盾发生变化10年前的技术和方案,放到10

    1小时前
    00
  • 如何打造高效AI智能体?

    作者|Barry Zhang, Anthropic地址|出品|码个蛋(ID:codeegg)整理|陈宇明最近看到了 Anthropic 那篇著名的《Building effective agents》作者之一 Barry Zhang 在 2

    58分钟前
    00
  • 非nvidia卡torchvision报错修复: operator torchvision::nms does not exist

    在Ascend 910b上安装vllm, 会自动把torchaudio和torchvision安装上去.安装前代码语言:shell复制pip list | grep torchtorch

    57分钟前
    00
  • 20 万 POC,直接拿来用,这不是测试,这是拒绝服务!!!

    之前看到很多人分享 github 上的一个项目,自动收录全网 nuclei 模板文件,目前已经 19 万了,如果直接拿来对目标进行漏洞探测,无疑会对目标造成巨大伤害,意味着可能要对目标发起十九万次请求以上,可以说是一次小型的 DDoS 攻击

    55分钟前
    00
  • ascend pytorch 踩坑.

    在910b上安装pytorch 和 pytorch_npu, 因为后续准备装vllm, 所以torch_npu是特殊的版本.代码语言:shell复制pip install torch==2.5.1 --extra-index pip in

    44分钟前
    00
  • 3、win10重装系统后Mysql环境和数据的恢复

    因为电脑是机哥的原因,重装了好几次电脑,因为我习惯把软件都装在D盘。所以很多东西都还比较好恢复,在网上学会了怎么不卸载重装数据库,自己记录以备后面自己查

    36分钟前
    00
  • 什么是docker?它是如何工作的?

    想象一个场景,你要部署一个服务,然后它对环境有很多依赖,不同的操作系统又是不同的需求,而且还可能遇到有些源不能使用,又得一番折腾,折腾完上线后,假设要在新的环境再来一套,又得再来一遍。那么有没有什么办法可以解决呢?有办法,docker就是干

    31分钟前
    00
  • maxwell遇到的一则问题

    结论和原因maxwell的元数据库里面没有存储全部的schema数据(就是少数据了),导致相关表的DDL校验失败。PS:我这里maxwell的作用只是采集库表修改情况的统计粗粒度指标,因为之前maxwell在运行报错的时候,直接修改了pos

    20分钟前
    00
  • Windows Server20192022 Evaluation评估版未激活导致关机问题

    摘要:在安装Windows Server 20192022后,会出现系统版本为 Evaluation 评估版情况,如提示Windows许可证已到期,就

    18分钟前
    00
  • 人工智能与ai有什么区别

    一、引言:概念之辨的必要性在科技浪潮席卷全球的当下,人工智能(Artificial Intelligence,简称AI)已成为人们耳熟能详的词汇。然而,当我们深入探讨时,会发现“人工智能”与“AI”这两个表述在语义和使用场景上存在微妙差异。

    18分钟前
    00
  • 实现一个 MySQL 配置对比脚本需要考虑哪些细节?

    作者:李彬,爱可生 DBA 团队成员,负责项目日常问题处理及公司平台问题排查。爱好有亿点点多,吉他、旅行、打游戏爱可生开源社区出品,原创内容未经授权不得随意使用,转载请联系小编并注明来源。本文约 1500 字,预计阅读需要 3 分钟。引言想

    17分钟前
    00
  • Nat. Mater.

    大家好,今天给大家分享一篇近期发表在Nat. Mater.上的研究进展,题为:De novo design of self-assembling peptides with antimicrobial activity guided

    15分钟前
    00
  • 雨晨 22635.5170 Windows 11 企业版 23H2 轻装版

    文件: 雨晨 22635.5170 Windows 11 企业版 23H2 轻装版 install.esd 大小: 2920270404 字节 修改时间: 2025年4月8日, 星期二, 11 : 04 : 59 MD5: D5F8F0AD

    13分钟前
    00
  • 子网掩码是怎么“掩”的?用积木教你彻底搞懂!

    子网掩码是怎么“掩”的?用积木教你彻底搞懂!前言肝文不易,点个免费的赞和关注,有错误的地方请指出,看个人主页有惊喜。作者:神的孩子都在歌唱你是不是也曾被“子网掩码”这个术语搞得晕头转向?明明是学网络的第一步,却像是打开了数学世界的大门:2

    10分钟前
    00
  • 1.54G 雨晨 26100.3775 Windows 11 IoT 企业版 LTSC 24H2 极速版

    精简AERO外主题并增加一套壁纸主题(默认启用)误杀导致功能界面空白、因WMIC被默认移除系统可能会多次重启。 拒止连接 www.5909 拒止连接 www.mnpc 拒止连接 quark 拒止

    10分钟前
    00
  • 用Xshell8配置密钥登陆

    1.首先在服务端查看root.sshauthorized_keys是否存在,这是存储公钥的文件,若不存在需新建此文件 2. 打开Xshell8,选择"新建",选择"新建用户密钥生成向导" 给用户

    4分钟前
    00

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信