5 ms·
source code management is way beyond 'a computer utility', but since you brought it up, here are some other computer utilities: - dd - bash - find Most of tho
by ryanpers 14y ago
source code management is way beyond 'a computer utility', but since you brought it up, here are some other computer utilities:
- dd
- bash
- find
Most of those require quite a bit of time to master.
Now, moving past that, git isn't merely a computer utility, its a foundational element in programming. It's actually more primitive than a programming language itself! The thing that separates the high school students from the "professional" programmers is SCM, and mastery of it. Having seen hardcore dev done on 10m loc code bases in perforce, you need some perspective on how hard git is and isnt.
One of the biggest problems I find is that people attempt to understand git via the lens of SVN. Once you free yourself from the past and understand the basic fundamentals of git, and cast aside your svn-isms you will be zen.
I for one wouldn't hire a developer who isnt intimately familiar with at least one SCM system. Zip files named v1, v2, v3 anyone?
- einhverfr 14y agoBut you aren't going to sit down and spend a week learning all the ins and outs of dd, bash, find, or, say, grep. You are going to skim the docs, learn the minimum to do the task at hand, wash, rinse, and repeat. My path at learning SVN was that way too. Heck I didn't even learn the merge command for a couple years until I really needed to, and then I realized how much I had been missing. I think the big issue that some of us have with git is it can't do all the same things that svn can do. Of course a big problem with svn is it can't do all the things git can do. I wouldn't set nails with a ball peen hammer either.
- chris_wot 14y agoIf you want to use git, here's a 10 minute primer: 1. Create the git repository: git init 2. To commit any changes, you type in: git commit -a -m "thing that I changed" 3. To branch, you type in: git checkout -b newbranch 4. To switch back to a branch, you just type in: git commit -a -m "changes made on branch" git checkout <branch> 5. To merge in a branch to the current branch, you type in: git merge <branch> 6. To push to a remote repository, you first add a remote repository by typing in the following: git remote add origin git@example.com:my_project.git (origin can be anything, but a good convention to use for the main repo that you are pushing to). Now to push your changes, you just use: git push origin <branch> Most often you will use: git push origin master
- CJefferson 14y agoExcept, that isn't enough. What do I do if a merge fails? How do I abandon the merge (git certainly doesn't help you, it just keep complaning that there is an unresolved merge). Why do I get 'git push' telling me there is nothing to push, but 'git pull' telling me I have branches with resolved merges (because git push pushes only one branch, and git pull pull everything). Those are just two things I've seen beginners hit recently.
- jlgreco 14y agoFollowing the rest of the discussion, at those points you do what you do with any other tool you use: pop into the manpages for two minutes and figure it out.
- chris_wot 14y agoWhat do I do if a merge fails? From the man page of git-merge: Before applying outside changes, you should get your own work in good shape and committed locally, so it will not be clobbered if there are conflicts. See also git-stash(1). git pull and git merge will stop without doing anything when local uncommitted changes overlap with files that git pull/git merge may need to update. How do I abandon the merge? From the man page of git-merge: --abort Abort the current conflict resolution process, and try to reconstruct the pre-merge state. If there were uncommitted worktree changes present when the merge started, git merge --abort will in some cases be unable to reconstruct these changes. It is therefore recommended to always commit or stash your changes before running git merge. git merge --abort is equivalent to git reset --merge when MERGE_HEAD is present.
- deleted 14y ago[deleted]
- stevage 14y agoYour naive optimism is cute. :)
- retrogradeorbit 14y agoAs a mercurial user I look and that and go... gee that's complicated. All the 'origins' and named 'master' and email addresses and extra stuff. for ref the equivs are: 1. hg init 2. hg commit -m "message" 3. hg branch newbranch 4. hg update branchname 5. hg merge branchname 6. hg push