Solved

General questions about Git and Github..??

Posted on 2012-04-05
5
686 Views
Last Modified: 2013-11-26
I develop lots of class libraries for various things, and also websites in general, but I've never really used any version control system at all and I know I'm missing out big time.

I've been studying Git and Github, but I'm struggling a little bit to understand some simple concepts.  

- Should I create my local repository in the same directory I work from?  I seem to be getting conflicting information on this.  Many of the video and reading guides I find online seem to do this, but then I'm confused on how I handle config files and things that I have to update locally in order to work on it, but I don't want to include my local version of the config file when I push files back to the remote repository.  I know I can pick and choose which files to push at any given time, but if I end up with of stuff like that it seems like it'd be tough to manage..??

- Is there some sort of standard for setting up forks and branches?  Different guides seem to do things different ways, and when I fork another project I'm a little confused on all the different branches I see there.

If I'm creating my own repository on Github for a class of mine, do I create separate branches for "master", "stable", and "development"?  Is there guide less than 100 pages long on understanding how that all works together?  It seems like I keep reading lots and lots of info but I'm not comprehending anything on how to actually use this stuff.

- Can I use Git on my own web server to manage general websites that I build (and any project I want, really) rather than using Github?  

I know I've got more questions but I don't want this to get too crazy right away.  Any information on the above would be awesome.  Thanks!
0
Comment
Question by:Andrew Angell
  • 2
5 Comments
 
LVL 28

Accepted Solution

by:
pepr earned 500 total points
Comment Utility
I am not using Git for a long time.  However, I have been using CVS (CVSNT) actively, and SVN passively, and Mercurial passively (depending what project of others it was).  I did not like the form of advocacy for Git that Linus Torvalds used.  However, now I consider Git the best of the considered tool I have met.

> Should I create my local repository in the same directory I work from?

Simply said, yes.  But Git is very nice here.  It creates only one .git subdirectory in the root of the tree where you work -- unlike the CVS or SVN that create subdirectories of the name recursively in the working tree.  Your project-root directory is treated implicitly by the .git.  It is not captured inside.  This way, you can freely move or rename the directory with respect to Git.

Git is very efficient when compared with CVS.  The .git subdirectory in your "project root" directory will not bother you.  It is small (well compressed).

Or the Git repository is created, or you clone existing repository. In both cases, you have your own local repository.

> I'm confused on how I handle config files and things that I have to update locally
> in order to work on it, but I don't want to include my local version of the config file
> when I push files back to the remote repository.


This should be clarified. I have probably solved something similar with storing the working version and the official version using different names.  You can also ignore the specific files via .gitignore file.

> Is there some sort of standard for setting up forks and branches?

I was also interested in that problem as I was used to work with the main truck and the development branch... The key to understand is to get used to that each commit is a full image of the project.  The branch is nothing more and nothing less than a pointer to that "point".  Actually, you are not interested in branches.  You are actually always interested in the commits (even in other systems), but other systems do not make it that apparent.  This way, you have much more freedom in Git.  The branches are extremely easy to create -- even for the old commits.  I would suggest here -- don't worry. Stay in the master until you find you should really branch.

> Can I use Git on my own web server to manage...

There are several protocols available for accessing the Git repository.  Basically, it means moving the files. The http or ssh protocols are usual for work with the repository.  However, I do not have active knowledge here.  But I have experience with making bundles -- you can transfer the changes a kind of off-line (say via mail).
0
 
LVL 11

Author Closing Comment

by:Andrew Angell
Comment Utility
Thanks for the info!
0
 
LVL 28

Expert Comment

by:pepr
Comment Utility
Thanks for the points.  I suggest to try the "Git Gui" tool that comes with the Git.  There is also an excelent "gitk" twin application for displaying the history and doing some commands (like creating a branch from a selected commit).  Both applications can launch the other.  The beginner rarely needs more operations with Git than those available via the Git Gui and gitk ("git tag -d mytag" is one of those).  It definitely helps to start quickly and to learn the command-line Git commands.  At least, I am in that stage :)
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

You can provide a virtual interface for remote stakeholders in a SWOT analysis through a Google Drawing template. By making real time viewing and collaboration possible, your team can build a stronger product.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now