Git Commands

Payilagam – Day – 05: 18-Feb-2024

Topic: Git Commands

Git commands used to manipulate the workflow of the Version control of our projects.

git clone <project link (.git)>

It clones the remote repository to our local repo…


This content originally appeared on DEV Community and was authored by Vasudevan Tamilarasan

Payilagam - Day - 05: 18-Feb-2024

Topic: Git Commands

Git commands used to manipulate the workflow of the Version control of our projects.

  1. git clone <project link (.git)>

    It clones the remote repository to our local repository in our local machine.

  2. git add <filename> (or) .

    This command used to stage the changes in our local repository to a staging area, hence git easy to commit the changes and its versions.

  3. git commit -m "commit message"

    In this step, we made the commit to our local repository(.git) with version info's and with a commiit messages. Commit message will be anything but it should be reasonable.

  4. git push

    For now, we make the version controls only within our local system. git push command used to push the source files and version info to the connected remote repository, in this case we use Gitlab, you may use Github or any other repository management systems.

  5. git restore --stagged <filename>

    This command restore the tracked changes to its default state(i.e git leaves the tracking information from its memory or untracked state).

  6. git log (or) git log --oneline

This shows the logs of the push and pull requests made to the local repository.

Note: These all commands only works within a directory, where we initialized the git repository, or else these commands won't work either.


This content originally appeared on DEV Community and was authored by Vasudevan Tamilarasan


Print Share Comment Cite Upload Translate Updates
APA

Vasudevan Tamilarasan | Sciencx (2025-02-19T08:07:34+00:00) Git Commands. Retrieved from https://www.scien.cx/2025/02/19/git-commands-3/

MLA
" » Git Commands." Vasudevan Tamilarasan | Sciencx - Wednesday February 19, 2025, https://www.scien.cx/2025/02/19/git-commands-3/
HARVARD
Vasudevan Tamilarasan | Sciencx Wednesday February 19, 2025 » Git Commands., viewed ,<https://www.scien.cx/2025/02/19/git-commands-3/>
VANCOUVER
Vasudevan Tamilarasan | Sciencx - » Git Commands. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/02/19/git-commands-3/
CHICAGO
" » Git Commands." Vasudevan Tamilarasan | Sciencx - Accessed . https://www.scien.cx/2025/02/19/git-commands-3/
IEEE
" » Git Commands." Vasudevan Tamilarasan | Sciencx [Online]. Available: https://www.scien.cx/2025/02/19/git-commands-3/. [Accessed: ]
rf:citation
» Git Commands | Vasudevan Tamilarasan | Sciencx | https://www.scien.cx/2025/02/19/git-commands-3/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.