You are not logged in.
OK guys, I've tried several times to get my head around CVS, SVN and GIT but they're just not making sense. I need a simple, easy to understand and use code repository for a single developer.
The code I work on has a single maintainer (me) so I don't need distributed, multi-person, multi-language, multi-timezone I-can-do-everything type system like the above packages... Just something simple that will allow me to have the ability to:
1) Flag a particular set of files as the current stable and be able to 'check out' those file for use / compilation.
2) Work on a development / testing line of code.
3) Revert back to the last "stable" if my testing / development ends up being a bucket load of fail.
4) Have a history of the code so I can see when things were added/removed.
I don't even know if such a thing exists, but if it does, it would be handy. Something a step above taking a tarball of the code when it's stable and untarring it back if I fsck things up
Maybe I'm better off sticking with manually tarballing things? Maybe I shouldn't be coding things if I can't understand CVS / SVN / GIT?
Last edited by fukawi2 (2009-05-29 11:43:28)
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
Well there's mercurial, but I stopped using that once I found git. Git branches are really awesome, and very easy.
I wrote/found this cheatsheet when I started using it:
http://wiki.archlinux.org/index.php/GIT
There's also another one, but more detailed and oriented towards working with others and sending things upstream.
http://wiki.archlinux.org/index.php/Sup … _Git_Guide
Last edited by iphitus (2009-05-28 10:51:50)
Offline
Ironically, git's learning curve is probably not as steep if you're learning it from scratch instead of coming from an existing system. I suggest taking the time now to learn the basics that you'll need as a single developer -- ignoring the distributed features and other things you don't need are trivial, but knowing that something like git-bisect or git-rebase is available when you need it will allow you to experiment fearlessly.
I don't know of anything 'simpler' than the tools you mentioned -- Mercurial, bazaar, and darcs are all options, but I suspect they're a bit heavy for you.
Dusty
Offline
I'm using CVS to work on CS-Man because me and my friend just need something basic/simple and there's support for it right in the Eclipse IDE. We only use a subset of its features, and I like it so far. The use to us is quickly updating code that is then accessible from anywhere, and the revision history itself.
Offline
Thanks guys -- I guess I'll have to keep looking around, and/or devote more time to trying to get my head around things.
iphitus -- Allan pointed me to those in another thread a week or so ago when I asked OT about simple GIT guides. They both make my head spin though
I forgot to mention, I tend to code using vi, none of this fancy GUI IDE stuff like Eclipse or NetBeans However that means I don't get to use the code repo functions of these IDE's too
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
OK guys, I've tried several times to get my head around CVS, SVN and GIT but they're just not making sense. I need a simple, easy to understand and use code repository for a single developer.
The code I work on has a single maintainer (me) so I don't need distributed, multi-person, multi-language, multi-timezone I-can-do-everything type system like the above packages... Just something simple that will allow me to have the ability to:
1) Flag a particular set of files as the current stable and be able to 'check out' those file for use / compilation.
2) Work on a development / testing line of code.
3) Revert back to the last "stable" if my testing / development ends up being a bucket load of fail.
4) Have a history of the code so I can see when things were added/removed.I don't even know if such a thing exists, but if it does, it would be handy. Something a step above taking a tarball of the code when it's stable and untarring it back if I fsck things up
Maybe I'm better off sticking with manually tarballing things? Maybe I shouldn't be coding things if I can't understand CVS / SVN / GIT?
When I saw the title of this post, I was about to recommend RCS. But it seems to me that your needs are relatively complex. So IMHO, you'll want a tool that is robust and complex enough task. And from what you've described I think something like git would be perfect. I'm sure mercurial or bzr would work just as well. Learning git is a lot simpler than learning vim or emacs!
Here are the steps I would use for the scenario you described above:
1) Create a repository. In your working directory type:
- git init [initializes repo]
- git add . [adds all files in the directory to the repo]
- git commit -a -m "Creating master repository" [Commits those files to the repository.]
2) Create a new branch for messing around with.
- git checkout -b "crazy-changes" [create and switch to a new branch named "crazy-changes"]
- Make a bunch of crazy changes.
- git branch [double check to make sure you're on crazy-changes branch]
- git commit -a -m "Some crazy changes" [-m is the message flag; if you don't add you'll be prompted to create a message in your default editor]
- Test the changes.
3) If the crazy-changes branch was a bucket "load of fail":
- git checkout master
- git branch -D crazy-changes [capital D here deletes the branch even if it has unmerged changes]
4) If the crazy-changes branch was good:
- git checkout master [switch to master branch]
- git pull . crazy-changes [merges crazy-changes into master branch]
5) See the history of your changes
- git log
6) Backup your repository.
- git clone . /path/to/backup-repo
Repeat as needed. Obviously, there's a lot more complex stuff you can do (tags, remote repositories, etc.). But I think this should cover the requirements you described.
Last edited by madalu (2009-05-29 01:18:48)
Offline
I'm afraid I may have just duplicated what's already in the wiki. Oh well, there can never be too many git cheat sheets!
Offline
Nice madalu, thanks
I presume the pwd for each step above would be:
1) /path/to/code/repo
2) /path/to/testing
3) /path/to/testing
4) /path/to/testing
What do I do to get my stable branch for production?
cd /srv/http/production/
git checkout -b "production"
Is that right? Would that possibly make code (history) etc available for anyone with a WWW browser to access through a .git directory or something (bad)? Then once I've done crazy-changes and committed that branch back to the master, repeat again?
Last edited by fukawi2 (2009-05-29 01:32:54)
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
Since you are using Vim, you might possibly try a repository manager script like vcscommand.vim : CVS/SVN/SVK/git integration plugin
To know or not to know ...
... the questions remain forever.
Offline
There is a tool for beginners (like me) with git : gitk
It's a GUI that allow you to do simple management on your project.
Offline
Nice madalu, thanks
I presume the pwd for each step above would be:
1) /path/to/code/repo
2) /path/to/testing
3) /path/to/testing
4) /path/to/testing
In fact, all this takes place in your code directory. So let's say you were already working on the project "~/foobar/".
Even if you had been working on it for years already, you could still initialize a git repo in it by using step one (git init; git add .; git commit -a).
This will create the data for the repo in the directory "~/foobar/.git". (BTW, you could get rid of the repo at any time by deleting the directory "~/foobar/.git").
The beauty of git is that when you switch to another branch, your path doesn't change. So when you do "git checkout -b crazy-changes", you'll still be working in "~/foobar/". But when you change and commit to crazy-changes, the changes will be committed only to the crazy-changes branch. Thus, if you switch back to the master branch ("git checkout master"), you'll still be in "~/foobar/", but you won't see any of your crazy-changes. Even better, you can have as many branches as you want. So in my example above, you wouldn't necessarily have to delete the crazy-changes branch even if you didn't like what you did. (I've heard it reported that Linus Torvalds thinks of git as a really sophisticated file system.)
What do I do to get my stable branch for production?
cd /srv/http/production/ git checkout -b "production"
Is that right? Would that possibly make code (history) etc available for anyone with a WWW browser to access through a .git directory or something (bad)? Then once I've done crazy-changes and committed that branch back to the master, repeat again?
For this you could use "git archive" to spit out a snapshot of your repo---either the current commit (HEAD), a particular branch, or any version/commit in the past.
See http://www.kernel.org/pub/software/scm/ … chive.html
Last edited by madalu (2009-05-29 03:50:59)
Offline
Nice madalu, thanks
I presume the pwd for each step above would be:
1) /path/to/code/repo
2) /path/to/testing
3) /path/to/testing
4) /path/to/testingWhat do I do to get my stable branch for production?
cd /srv/http/production/ git checkout -b "production"
Is that right? Would that possibly make code (history) etc available for anyone with a WWW browser to access through a .git directory or something (bad)? Then once I've done crazy-changes and committed that branch back to the master, repeat again?
the pwd doesnt change. Here's an example of how branches work.
iphitus@tsiolkovsky:~/packages$ git init # just a few lines to create an example repo...
iphitus@tsiolkovsky:~/packages$ git add PKGBUILD
iphitus@tsiolkovsky:~/packages$ git commit -a -m "wha"
[master (root-commit) 2cffc7b] wha
1 files changed, 23 insertions(+), 0 deletions(-)
create mode 100644 PKGBUILD
iphitus@tsiolkovsky:~/packages$ git branch # list of branches, just master at the moment.
* master
iphitus@tsiolkovsky:~/packages$ git branch breakstuff # branch created
iphitus@tsiolkovsky:~/packages$ git branch # see the new branch?
breakstuff
* master
iphitus@tsiolkovsky:~/packages$ git checkout breakstuff # change to the new branch
Switched to branch 'breakstuff'
iphitus@tsiolkovsky:~/packages$ git branch # See how breakstuff is now selected. I can now break things, but master is always there to swap back to.
* breakstuff
master
iphitus@tsiolkovsky:~/packages$ git checkout master # change back to master
Switched to branch 'master'
Just like that, you can change between different working branches of code.
As for sharing a repo... have a look here.
http://toolmantim.com/articles/setting_ … repository
In the 'impatient' section
* you create a bare git empty repository on the remote host. You can make it locally and upload if you want.
* Add that remote repository as a branch on your local repository
* git push to that branch you just created.
It explains it in more detail further down the page.
Last edited by iphitus (2009-05-29 03:58:08)
Offline
Hmmm, starting to make sense guys -- thanks heaps for your patience and time
Last question I hope... The idea is to never actually change 'master' directly but to checkout a branch, make changes, and then merge ('commit') them back to master? Is that correct?
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
You can do so, yes. You can change master itself of course, it is just another branch. It's more like how you want to do those things.
Offline
Also with git you have http://github.com which is absolutely fantastic. Check out their guides section. If you google around for git guides, there's a lot more too.
[git] | [AURpkgs] | [arch-games]
Offline
Thanks again guys... I'll mark this as solved for now, and have a play around
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
OK, so I've been having a play, and I'm trying to get my dotfiles into a git repo to try and keep some kind of order for my bashrc, ssh config etc between my home desktop, home server, work desktop, laptops and various servers around the world
So I've started with my home server, and init'ed a git repo in my home dir, then added .ssh/confg and my ssh private key
fukawi2@kangaroo ~ $ git init
Initialized empty Git repository in /home/fukawi2/.git/
fukawi2@kangaroo ~ $ git add .ssh/config
fukawi2@kangaroo ~ $ git add .ssh/privatekey_personal.dsa
fukawi2@kangaroo ~ $ git commit -m 'initial commit of ssh config and key'
[master (root-commit) cd0dac1] initial commit of ssh config and key
2 files changed, 112 insertions(+), 0 deletions(-)
create mode 100644 .ssh/config
create mode 100644 .ssh/privatekey_personal.dsa
I then added a remote repository (one of my VPS'es) which I want to act as the 'central' server I can access from anywhere to pull/push any changes I make from any of my computers:
fukawi2@kangaroo ~ $ git remote add emu ssh://emu/home/fukawi2/
fukawi2@kangaroo ~ $ git push emu master
Counting objects: 5, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 1.36 KiB, done.
Total 5 (delta 0), reused 0 (delta 0)
To ssh://emu.falconn.nl/home/fukawi2/
* [new branch] master -> master
How do I now get *that* VPS (emu) to see my dotfiles? They seem to only exist in the .git directory in my home, and I can't figure out how to clone/pull the repo.
Last edited by fukawi2 (2009-10-18 02:37:26)
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
Remember when I recommended git, how I said "push" was a little funny?
Git, by default, assumes you are pushing to a computer being used by someone. As such, it will not change the working files, just add the updates to the repository (e.g, it will not nuke whatever they are working on). The person on the pushed computer will notice this and take the necessary action, either merging the changes or reseting forwards (yeah, weird) to the new head.
Automatic pushing to remote computers:
http://git.or.cz/gitwiki/GitFaq#Whywon. … push.22.3F
Glad git is starting to work out for you. Here is the guide that made it click for me:
http://www.eecs.harvard.edu/~cduan/technical/git/
late edit: Tig (in community) is a good way to explore the logs.
Last edited by keenerd (2009-10-18 06:09:32)
Offline
That is a good document... It's cleared some things up but I still can't get this to work.
On the remote server, in my home directory:
git init
On my local server, in my home directory:
git init
git add .ssh/config
git remote add emu ssh://emu.domain.com/home/fukawi2/
git commit -a -m 'initial commit'
git push emu master
This pushes the changes as commits to the .git directory on the remote server, but doesn't create .ssh/config on the remote server. If I login to the remote and run:
git clone ./
It then creates /home/fukawi2/fukawi2/.ssh/config - note the second level of 'fukawi2' within my home directory.
Last edited by fukawi2 (2009-10-18 07:03:41)
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
Either enable the push hook described in the git FAQ link (so that pushes overwrite the working directory), or use the command
git reset --hard HEAD
on the remote system.
"git clone" will always make a new repo. So if you are in /tmp/, and you "git clone /home/fukawi2/", it will mirror the repo to /tmp/fukawi2/. If you are in /home/bob/, it will make the repo /home/bob/fukawi2/. Finally, if you are in /home/fukawi2/, it will make /home/fukawi2/fukawi2/, and you'll have a repository inside a repository. Please don't do this.
If it seems confusing, just think of the git repo as a tarball, and unzipping/cloning it produces the files in a new directory of the same name.
Last edited by keenerd (2009-10-18 09:05:04)
Offline
Either enable the push hook described in the git FAQ link (so that pushes overwrite the working directory), or use the command
git reset --hard HEAD
on the remote system.
That was the command I was after, thanks
Now to read up on exactly what it means...
EDIT: answered my own question
Last edited by fukawi2 (2009-10-18 21:30:27)
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
Yay, another problem!
I have stuff hosted with github... I created a new branch on my work computer and pushed it to github, so now I have "master" and "iptables-rewrite" branches on github.
I tried to pull those changes from github to my home computer using:
git pull github master
Which was all good, but it didn't pull the 'iptables-rewrite' branch. So I ran:
git pull github iptables-rewrite
And it pulled the branch, but it seems to have overwritten my local master with the remote iptables-rewrite branch! I can't figure out how to get rid of the 'iptables-rewrite' changes from my local master branch. If I try to pull the github/master branch again, it says it's already up to date
fukawi2@phil-desktop ~/ArchServer/base $ git branch
* master
fukawi2@phil-desktop ~/ArchServer/base $ git pull github master
From github.com:ArchServer/base
* branch master -> FETCH_HEAD
Already up-to-date.
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
I guess you wanted to create a local branch with the iptables-rewrite branch.
git checkout -b iptables-rewrite origin/iptables-rewrite
Offline
Yes, that's probably the one.. Thanks Allan
Any suggestions how to revert my local 'master' to be the correct master instead of the 'iptables-rewrite' branch? You command with 'master' instead of 'iptables-rewrite' gives me:
fatal: git checkout: branch master already exists
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
Ah-ha! Found it
git reset --hard HEAD^
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline