SussexMPhys2016 / go

0 stars 3 forks source link

Homework for Friday (1) #1

Closed dorksquith closed 7 years ago

dorksquith commented 8 years ago

(1) CLONE GIT REPOS AND ADD AN IMAGE FILE

Method 1 : (easy, fast)

Method 2 : (additionally learn something about the command line)

Reply to this thread on any problems or successes you have!

@SussexMPhys2016/machinelearninglhc

VeryAlienUser commented 8 years ago

I found method one didn't work. I installed GitHub desktop (which automatically install the git language and shell) and tried to clone the repository from the desktop application, but it gave me an error (not sure what it meant). I then tried using the terminal (command prompt), but it said that "git" was an unrecognised command.

It is possible to clone the directory from the command line on Windows, but only through the git shell itself (you can find this in the start menu). Running your terminal line above ("git clone https://github.com/SussexMPhys2016/go") in the git shell successfully clones (downloads) the repository, placing it in "Documents/GitHub/go".

Regarding adding a file to the remote repository, I decided to use the command line the whole way, in case the in browser controls still failed to work. This is done by: Copying the file into the local folder ("Documents/GitHub/go") Running the git shell Typing "git add " (This adds the new file to the index of things to be saved in the next commit) Typing "git commit" (This saves any edits in the index to the local repository) Typing "git push" (This uploads any edits from the last commit to the remote repository)

Obviously the bits about command prompt are Windows specific, but all of the git commands should work on any system.

dorksquith commented 8 years ago

Thanks to @TheOriginalGodOfHellfire for these nice details. I confirm that the following works for me on the mac osx terminal command line:

git clone https://github.com/SussexMPhys2016/go
cd go
cp /path/to/picturename.jpg .
git add picturename.jpg
git commit -m "Lily's picture upload"
git push

Where I have used two unix commands: cd (change directory) and cp (copy)