A crash course on git commands and maybe HTML/CSS for any level programmer
- Make Github account lol
- Install git
- Install a text editor (Sublime, VSCode, Atom, etc.)
- If you're in mac, open up your regular terminal. If Windows, use powershell because I'm lazy and can't remember the different commands for Windows command prompt
cd <name of repo>
goes to that folderls
lists all folders in current directorypwd
tells you your current working directory.
single period means 'current directory'. So if you docd ./<name of file>
it will look for a file in your current directory..
two periods mean to go up a directory. Socd ../<name of file>
will look for a file in the directory a level above
git clone <link to project>
clones that project folder into your current directorygit add .
adds all the files in your current directorygit commit -m '<write commit message>'
makes commit with a custom message. Double check your file changes toogit push
pushes your changes to remote thingie on Githubgit pull
pulls latest version and changes from remote project stuff- There's also this thing called branches but again I am lazy and usually don't make too many drastic changes...basically you can make different versions of your code on different 'branches' so that you can work on different features without risking messing up the master branch. This is really helpful for group projects if you want to split up the work or code different things, but since it's usually just one person making minor changes then you can look into it later if you're interested ^_^
git revert <commit reference>
is kind of like an undo button in case you want to revert changes but you also need to know which commit you want to revert to- For more git commands the websites I linked at the bottom should be more in depth
- If you want to see changes on the site just on your own laptop, open the index.html file in Chrome so that the URL should be something like 'file:///Users/christinesun/GitHub/freshproductionsucla/index.html'. When making changes, be sure to save it each time and refresh the page again to see changes reflected.
- Another helpful thing is the Inspect Element button! If you're not sure if the CSS will actually change the right thing, then you can change the HTML/CSS directly in the browser. Here's a neat cheat sheet on that: https://appletree.or.kr/quick_reference_cards/Web_Browsers/chrome-developer-tools-cheatsheet.pdf
- If you want that change to go onto the actual site, then do
git add .
git commit -m '<some comment message>'
git push
- and then refresh freshproductions.art to see if the changes take effect (sometimes there might be a lag)
- Usually there shouldn't be any merge conflicts if there aren't multiple versions