Home‎ > ‎git‎ > ‎

Git Notes



git int
make a local git repo
(basically make a .git directory)

git clone https://git.cmed.us/tech.git
copy/download repo from git.cmed.us to the current local dir

git status
status of current repo (in current local dir)

git branch
a "save-as" of the current repo.  Makes a copy of the current repo that you can then mess with later without messing with the original.  

git checkout <branch-name>
switch to a different active branch. You can switch between the 3 branches with this command. 
There is also git checkout -b <branch-name> which is the same as git branch, but makes that new branch active.

git diff <branch-name> <other-branch-name>
See the difference between the two branches

git add <file> <file> ...
add files to be "staged" (prepped to be checked in)
(use git status to see what's staged and what's not)

git reset <file>
opposite as git add  
takes files out of stage

git commit -m "what's going on"
Take all files in stage (all files check in) and add them back to the repo. 

git push
git push <origin> <breach>
push the current branch or the repo to the site (origin) you originally downloaded it with the git clone command.  

git pull 
git pull <origin> <master>
 grab the <master> branch from the remote <origin> server (where you downloaded the repo via git clone command). 

git log --all --decorate --oneline --graph
graphicly show all of the checkin's and the different branches




Comments