top of page

Github Basic Info

Side Notes

  • head (where you last committed)

  • git log --graph (makes the branch vertical)

  • rm <filename> (removes file)

  • # value (a specific value; shows a bunch of random yellow numbers & letters)

  • control c (break)

  • master branch (main coding area)

Making directory

mkdir hashpractice (makes the directory)

cd hashpractice/ (calls directory)

ls (list directory)

pwd (where you are)

ls

ls -al (list all hidden files)


Making a file

touch <filename>.txt (makes a file)

git add <filename>.txt (or can use ".")

git commit -m "Adding <filename>.txt” (-m = message)

git log (shows all the commits made)

Making second file

same steps above


How to Move Head

git checkout <File1.txt’s # value>

  • file2.txt isn’t seen (check explorer page)

  • git log (shows only File1.txt)

git checkout <File2.txt’s # value>

  • moves back to file2.txt


Create a Branch

git branch new-branch

git log

  • the head is no longer in master branch but in a new branch

  • can delete/add files in new-branch but won’t change in master branch


Removing file

git rm (<Filename>.txt)

git status

git commit -m “Removing <Filename>.txt”


Creating file in New-Branch

touch File4.txt

git add .

git commit -m “Adding FIle4.txt from new-branch”

git status


Merging New-branch into Master Branch

git checkout master (going back to master branch and see changes made in the new-branch aren't seen in the master branch)

git merge new-branch (see all the files from new-branch into master branch)

Kommentare


Featured Posts
Recent Posts
Archive
Search By Tags
No tags yet.
Follow Us
  • Facebook Basic Square
  • Twitter Basic Square
  • Google+ Basic Square
bottom of page