The command line is fast. Really fast. These posts are some reminders i made to help inform myself about git commands that are important. Some terms before we start
Commit – To commit your changes (literally means to commit)
Staged – To prepare for a commit, but is NOT a commit(this is one step before commits)
Cloning existing git repos
$ git clone https://yourgitrepurlhere
Checking your git status (modified,unmodified etc) – more regarding changes here (https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository)
$ git status (include -s for a short status)
Ignoring files (put them into a .gitignore file eg:)
# ignore all .a files *.a # but do track lib.a, even though you're ignoring .a files above !lib.a # only ignore the TODO file in the current directory, not subdir/TODO /TODO # ignore all files in the build/ directory build/ # ignore doc/notes.txt, but not doc/server/arch.txt doc/*.txt # ignore all .pdf files in the doc/ directory and any of its subdirectories doc/**/*.pdf
$ git commit -m "Commit name here!"
The above command commits the changes mentioned in git status, furthermore… you need to push to update remote copy (if on github, or any other remote repository)
Push to remote repository
$ git push
$ git mv file_from file_to
Everything else can be found on the git-scm website. Of course, making use of software like Github Desktop or SourceTree can be very useful. However I still think that learning a little git on the command line can help in the near future.
Why am i learning this?
Why am i indeed you may ask? I am merely curious and intend to explore how to make use of git (the cmd version) and attempt to make my very first web-application on a MVC layer (not ASP.NET core) with the Symfony framework. I should also note this PHP command down… (i keep on forgetting how to run the application..)
$ php bin/console server:run
Updated 10/08/2018 9:15PM – updated if any important things are missed out!