Reading notes about code for my future reference.
Revisions and the Cloud
A Local VCS entails one database on your hard disk that stores changes to files.
This system is a single server storing all changes and file versions, which can be accessed by various clients.
It works like a CVS but with multiple redundancies!
Its a DVCS that saves every revision made, it also resides on the local disk, it will track changes and since it is backed up by multiple servers it will be hard to lose data.
It includes GUI tools or Graphical User Interface, but can also utilize 3rd party tools.
This command allows you to clone an entire repository! $ git clone https://github.com/test This command allows you to clone the repository into a another directory! $ git clone https://github.com/test mydirectory
Made up of 3 parts!
-Working Directory: The actual files reside here.
-Index: The area used for staging
-Head: Points to the most recent commit
Files can either be Tracked or Untracked
Tracked files can be modified, unmodified and staged. Since they are part of a snapshot!
Untracked files are in the last snapshot and cannot be modified in the current staging area!…
Files go from Untracked to Unmodified to Modified to Stages and back to Untracked and the cycle goes over.
$ git status
Lots OF CODE! Single File
git add filename
All Files
$ git add *
After you use the aforementioned commands you should see this!
$ git status
On branch master
Changes to be committed:
(use “git reset HEAD …” to unstage)\
new file: EXAMPLE
Once you see this you can proceed to committing your files!
$git commit -m “made change x,y,z”
$ git commit -a *This command commits a snapshot of all modifications to tracked files in the working directory.
$ git push origin master
*This command pushes changes from the local “master” branch to the remote repository named “origin”.
*For cloned repositories, Git will automatically give the name “origin” to the server from which you cloned and the name “master” to your local repository. However, these names can be changed by the user.
git stash
Great for applying changes and not losing them.
git stash apply Great for continuing projects!