Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git - best practices (in general, and from a perspective of former SVN user.)

Tags:

git

svn

git-svn

Recently I have learned the basics concepts of Git. We did use a bit of git-svn to get familiar with using it. I would like to start my first "true" project on git along with my friends.

Therefore I would like to ask you what are the best practices of using Git in general, and if there are any pitfalls that SVN familiar developer my get into?

like image 863
Kamil Zadora Avatar asked Jan 21 '09 20:01

Kamil Zadora


People also ask

What is Git and how does it differ from SVN?

The difference between Git and SVN version control systems is that Git is a distributed version control system, whereas SVN is a centralized version control system. Git uses multiple repositories including a centralized repository and server, as well as some local repositories.

Which feature of Git makes attractive over SVN?

The biggest difference between Git vs Subversion (SVN) is that Git version control is distributed while SVN is centralized. There are also key differences in repositories, branching, and more. If you're considering switching from SVN to Git, you'll want to take these into account.

What is your understanding of SVN Git?

In git every user has their own copy of code on their local like their own branch. In SVN there is central repository has working copy that also make changes and committed in central repository. In git we do not required any Network to perform git operation. In SVN we required Network for runs the SVN operation.


1 Answers

Collaboration among more than one developer is probably best done using a central "bare" repository, which is roughly analogous to a repository in Subversion. Sharing changes between two or more people with only their own repositories, is difficult and prone to error. Also, using a central repository will feel more comfortable coming from a Subversion background.

One great thing about Git is that you can easily have more than one "common" repository. I have my development set up so I keep a set of bare repositories on one server that I usually interact with ("origin" for most of my projects), but for some projects I also push the whole thing up to GitHub. I don't have to choose which one is the single central repository, I can pull and work from the GitHub repository and later push to my own copy.

like image 54
Greg Hewgill Avatar answered Nov 06 '22 03:11

Greg Hewgill