Hi friends,
Today I will be given a few insights on git which is a great control version system or cvs that helps develop projects with remote peers and interact with the same codebase without blocking each other or waiting for someone else work.
If you have never used git I would highly recommend taking this codeacademy course it is free and teach you the basics. I must admit that when I started using git was really changing coming from a subversionn world where everything was done differently.
I've seen that we tend to use few commands that we actually need but I will try to explain that in a video that I will be uploading later on.
This is usually the first git command you will most likely perform. It is how you will get a remote repository and clone it locally as we call it local repository. Starting from this, you will have to get used to get everything from remote and send everything to remote. This is pretty much the description for the next 2 commands.
Get everything from the remote repository syncing the references with the remote onces (not really perfoming the changes) as you should perform git pull in the branch you want to update to actually get the changes. Changes on other branches will not be performed but a message will show up saying you are X amount of commits behind.
Usually once you add new files or modify existing files your changes have to be marked as good to add to remote repo. This just starts the send process to the local branch and then to the remote.
Pretty much splits changes and set them a meaningful message to let know other developers what the change is and why you have done it. The idea with each commit is to isolate changes that add new functionality and are easy to read and understand, hence why I will talk about rebase and squash later on.
Once you have a batch of one or more commits ready to go from your local repo to remote or origin, you have to push them to the configured remote url that can either be (github, gitlab or any other service).
This commands serves to purposes, the first is to undo local changes with what ever changes were at the beginning pulled from remote. Second usage is when you add a -b flag creating a new branch with changes from the previous branch. Pretty neat feature to start working on unfinished features that are frequently updated and then you can get the changes as you re doing your own stuff (pull and rebase require, there is another option that we could use called cherry-pick)
Lists, create and delete branches, the most common usage is to list and delete branches.
This is the most useful command to sync, redo history log and get commits and history as you wish readers to see it. Pretty useful to get those debugging and development commits once pushed (ideally they never made it to the remote branch/repository)
Show the history of the commits for the branch you are standing on top.
It is useful for setting up user.name and user.email if you have never set it up or also the remote url.
This one undo and gets to an stable known commit forcing changes to be undone and removed.
I would like you to take a look at the video that will be linked soon. Thanks for reading.
Dtube video tutorial -> https://steemit.com/git/@raserrano/v0kg0eus