Hey, I am using git repo (or whatever the proper name for it is) with my group for project.
We are using bitbucket and Eclipse, it's all setup and working fine but I am having few questions:
1) When submission is made, does it upload and replace files completely or just removes/adds new edited lines?
2) If I am working on project, and someone else in my group is at the same time, if I click Commit and it uploads everything, then without refreshing my other member clicks commit and it appears we both edited same file and commited it, will his file be used? or will git/repo manage it and use original file and just insert my code lines and his?
3) What are branches used for? any good example for their use?
4) And I will have to describe why we decided to use git instead of just all working and sending files to each other.
5) How are those visual maps/presentations made? I mean recently there was a minecraft git visual video showing a tree-like structure with devs floating around. What is that called? do all git hosts support it?
6) What is proper name for this? Git/Repo/SVN? What is difference?
Thank you.
I've never used git, but
[QUOTE=arleitiss;40022293]2) If I am working on project, and someone else in my group is at the same time, if I click Commit and it uploads everything, then without refreshing my other member clicks commit and it appears we both edited same file and commited it, will his file be used? or will git/repo manage it and use original file and just insert my code lines and his? [/QUOTE]
You will probably be asked to [URL="http://wiki.eclipse.org/EGit/User_Guide#Resolving_a_merge_conflict"]resolve a merge[/URL]. No-one's changes will be discarded unless someone specifically does so
[QUOTE=arleitiss;40022293]5) How are those visual maps/presentations made? I mean recently there was a minecraft git visual video showing a tree-like structure with devs floating around. What is that called? do all git hosts support it?[/QUOTE]
Sounds like [URL="http://code.google.com/p/gource/"]gource[/URL]
[QUOTE=arleitiss;40022293]1) When submission is made, does it upload and replace files completely or just removes/adds new edited lines?[/QUOTE]
Git will record the difference between each commit (submission). Every commit you have made will be stored forever (unless you forcibly remove them).
[QUOTE]2) If I am working on project, and someone else in my group is at the same time, if I click Commit and it uploads everything, then without refreshing my other member clicks commit and it appears we both edited same file and commited it, will his file be used? or will git/repo manage it and use original file and just insert my code lines and his? [/QUOTE]
If you try and push (upload) your commits but someone has also just pushed, git will ask you to pull (download) their changes so they can either be automatically or manually merged. If the changes are to different files, git can usually merge the changes itself. Otherwise, you may have to merge them either by hand or with a mergetool like KDiff3.
[QUOTE]3) What are branches used for? any good example for their use? [/QUOTE]
Branches are so you can go off working on an experimental feature or refactor, or at least something that could disrupt the workflow of others working on the project. For example, if you are refactoring a major part of the system, it may not be compilable for a while and so you want to keep your changes separate to the branch being worked on by the rest of the team. Git will allow you to pull changes made by team-mates to your experimental branch at will, and you can do a merge at the end when you are done.
[QUOTE]4) And I will have to describe why we decided to use git instead of just all working and sending files to each other.[/QUOTE]
A goal that a pragmatic programmer should aim to follow is to automate repetitive tasks to save time and eliminate the risk of human error. Git automates the process of making sure everyone in a team is working with the same codebase (or branches of it), and makes it easy to record at what point changes are made. This means you can always go back in the history of a project if something goes wrong, and see what has changed between versions to spot why a bug has appeared.
[QUOTE]5) How are those visual maps/presentations made? I mean recently there was a minecraft git visual video showing a tree-like structure with devs floating around. What is that called? do all git hosts support it?[/QUOTE]
That was probably [url=https://code.google.com/p/gource/]gource[/url], you can do it with any git or SVN repository (and some other version control systems too).
[QUOTE]6) What is proper name for this? Git/Repo/SVN? What is difference?[/QUOTE]
Git and SVN are version control systems. A repository is in this instance (I might be wrong) a data structure containing the version history of a project. SVN is based around a single central repository, usually on a remote server, with clients that checkout from it and commit changes to it. Git is distributed and freeform, allowing any number repositories connected in any structure you like. However, you can treat it mostly like SVN with a central main repository and client repositories that only communicate with the central one. The main difference is all the client repositories store the entire history of the project too, like the server. This means there are usually more backups than a standard SVN repository.
[QUOTE=arleitiss;40022293]Hey, I am using git repo (or whatever the proper name for it is) with my group for project.
We are using bitbucket and Eclipse, it's all setup and working fine but I am having few questions:
1) When submission is made, does it upload and replace files completely or just removes/adds new edited lines?
2) If I am working on project, and someone else in my group is at the same time, if I click Commit and it uploads everything, then without refreshing my other member clicks commit and it appears we both edited same file and commited it, will his file be used? or will git/repo manage it and use original file and just insert my code lines and his?
3) What are branches used for? any good example for their use?
4) And I will have to describe why we decided to use git instead of just all working and sending files to each other.
5) How are those visual maps/presentations made? I mean recently there was a minecraft git visual video showing a tree-like structure with devs floating around. What is that called? do all git hosts support it?
6) What is proper name for this? Git/Repo/SVN? What is difference?
Thank you.[/QUOTE]
There's a lot of misunderstanding in your post so apologies if I seem harsh, I just don't want to spend too much time answering a question where I'm not sure what you're asking.
1: This is irrelevant. The only thing that matters is the end result. git is smarter than SVN and will remember changes in chunks if that's what you're asking.
2: In git, commits will never affect anyone else's repo. It will only be when you "push" the commits that there may be conflicts, at which point you will need to merge the code. There are techniques to avoid the amount of work you have to do when merging
3: This is hard to explain, but essentially you use a branch whenever you want to go a different direction with the code without stopping work on other areas. Others might be better at explaining this.
4: what?
6: "git" is the source control you're using and a "git repo" is what the repos are called. SVN has nothing to do with git, it's a different version control system.
Expanding on 4 for you.
Imagine you're a developer tasked with creating a new feature. For instance, 2-factor-authentication. You would create a new branch (2factorauth-feature) and be able to write all of the code for the said feature without affecting your production copy.
If you didn't use branching, the buggy and/or not fully implemented code would be served to the client. In this example, it could possibly result in users being locked out of their accounts.
[QUOTE=jetboy;40032392]For instance, 2-factor-authentication. You would create a new branch (2factorauth-feature) and be able to write all of the code for the said feature without affecting your production copy.[/QUOTE]
feature/2-factor-auth so that you can have things in pretty folders in SourceTree and other clients that support it.
Thanks, your answers helped a lot.
[QUOTE=KmartSqrl;40035263]feature/2-factor-auth so that you can have things in pretty folders in SourceTree and other clients that support it.[/QUOTE]
Could you elaborate on this? I thought branches were given names, and git worked out the file structure of them.
That would be the name of the branch, but by using a backslash in the name some GUI git clients will display your branches as though they were in folders. It doesn't actually change how git handles anything.
I do it with features, bugs, and hotfixes.
Sorry, you need to Log In to post a reply to this thread.