Posts

Showing posts with the label Git

Git commands cheat sheet

If you want to learn about Git I highly recommend Pro Git book, written by Scott Chacon and Ben Straub. Online version of the book is available here  https://git-scm.com/book/en/v2 Based on the Pro Git book the article here is a quick reference of the most common Git commands mentioned in the book. All content is licensed under the  Creative Commons Attribution Non Commercial Share Alike 3.0 license . Git Repository Initializing To add a directory that is currently not under version control to Git, go to that project’s directory and initialize. This creates a new subdirectory named .git that contains repository files. $ cd /u02/git/poc/myproj1 $ git init Cloning an Existing Repository If the repository exists and you want to set up on your laptop, easiest option is to clone the whole repository. There are options to clone a single branch if you want to. $ cd /u02/git/poc/ $ git clone https://github.com/ /myproj1.git This will create a directory call...