Re: [oll-user] Git for dummies
Resources for LilyPond and LaTeX users writing (about) music
Status: Alpha
Brought to you by:
u-li-1973
From: Phil H. <ma...@ph...> - 2014-01-11 15:27:57
|
----- Original Message ----- From: "David Webber" <da...@mu...> To: "oll-user" <ope...@li...> Sent: Saturday, January 11, 2014 3:07 PM Subject: Re: [oll-user] Git for dummies > From: Phil Holmes > >>{GitBash] >> With your permission, I'll focus on this, since I'm not familiar with the > Gui. FWIW I regard myself as a Windows power user, but since getting > involved in LilyPond I've had to adopt some Linux, to the point now where > I > sometimes type 'ls' into a Windows command prompt, where I should use > 'dir'.< > > OK, so reading between the lines, GitBash is a unix shell of some kind. > I > now have to drag microemacs out of the recesses of my memory. I used it > as > my C++ editor up to the mid 90s, and this is the only unix-style command > prompt I've ever used. Still GitBash seems to like my first attempts at > ls, pwd, mkdir, and cd, so I'm starting to feel that it is my friend :-) I guess it's a Unix-xtyle DOS shell, really. As I said, I now get confused between ls and dir. > So I've created my local engraving-challenges directory, navigated to it, > and done > > git clone https://github.com/MozartSoftware/engraving-challenges > > (DavidWebber is apparently a common name and I had to choose another ID). > >> You should see some stuff happening > > Stuff indeed happened, > >> and you should get a copy of the files from the remote repo on your hard >> disk. > > and I've already blundered. I created a directory called > .../engraving-challenges and went there. The files are now all a > directory > > .../engraving-challenges/engraving-challenges/ > > but I suppose I can live with that for now. I pretty much always do that :-( >> Lunch beckons: let me know when you've done that. > > Yes! I see I have a directory > .../engraving-challenges/engraving-challenges/challenge01/Mozart You should also see a number of other directories and files, for example engraving-challenges\challenge01\ chopin-godowsky.png (this was with Windows explorer for me - hence the \ / confusion. > Presumably I can put files there??? How do I upload them? Yes, you can put files into the Mozart directory, and git will recognise them there (probably). git status will give you an idea of what's doing $ git status # On branch master # Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # modified: Estrella.sib # # Untracked files: # (use "git add <file>..." to include in what will be committed) # # ../../challenge01/Sibelius-7/V1 - Full Score.pdf # ../../challenge01/Sibelius-7/V1_Bar4.sib # ../../challenge01/Sibelius-7/V1_Bar5.sib # ../../challenge01/Sibelius-7/V1_Complete - Full Score - Copy.pdf # Beaming.ly # Beaming.pdf # Notes.txt no changes added to commit (use "git add" and/or "git commit -a") So I see that I'm on branch master (back to this in a minute). I have one file that git is tracking that I've modified, plus a number of files that git is aware of, but is not tracking. So you should see the files you've copied to that directory in the "Untracked files" list. So, to get git to track them, we do: git add filename wildcards also work for filename, so git add *.png would work. There's one gotcha here: git has a list of filetypes it ignores in the .gitignore file, and by default .pdf is on this list - so if you're wanting to track and upload PDFs you'll need to edit .gitignore and get rid of the pdf entry. OK - we've added *.png to the list of files being tracked: we now need to tell git to take a snapshot of the current situation. We do this with a commit: git commit -am 'Commit message' a=all files; m=use this message. All other things being equal, you should be able to see what's there with gitk: this should open a GUI window and give a representation of what's going on. You'll need to close it to get the command prompt usable again. All that's now needed is to actually do the upload: git push You will be prompted for (your github) username and password. This should push your commit to the remote github server. This simple push syntax works fine on github, but if you get into more complex repositories, there are other options that will need taking care of. Think that should do for now. Summary: new files are added with git add; changes are snapshotted with git commit; changes are uploaded with git push. Once this is all OK, we can think about branches. -- Phil Holmes |