4 ms·
But 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 min
by einhverfr 14y ago
But 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
- lparry 14y agoHow does hg know where to push to? (honest question)
- chris_wot 14y agoYou edit .hg/hgrc. You also must run: hg outgoing What I'm interested in is how to switch to a different branch.
- retrogradeorbit 14y agoTo switch to a branch you go hg update branchname If you have uncommited changes it will refuse. You can 'shelve' the changes or force the update to the branch (with a flag on the command line).
- chris_wot 14y agoInteresting... must have a look at hg! But I'm not really sure that pushing is that much of a difficult concept, because you just have to add a remote and then use this to do your push. Not really that much of a difference... Edit: I've just realized... I probably need to clarify the command: git remote add origin git@example.com:my_project.git The only git keywords here are "remote add". Origin could be named anything you want (call it "external"), and the git@example.com:my_project.git is actually what points to the git remote repository. You can also use the same style URI if you want to use SSH, or even HTTP(S).
- retrogradeorbit 14y agoIt has a default setting. You can set the default in your .hg file. When you pull your repo from somewhere that becomes the default. You can also specify where you want to push to. eg. hg push ssh://hg@bitbucket.org/myusermame/project or hg push https://username:password@code.google.com/p/project/ https://username:password@code.google.com/p/project/