DEV Community

Vasudevan Tamilarasan
Vasudevan Tamilarasan

Posted on

3 1 1 2 1

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.

  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.

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (0)

The Most Contextual AI Development Assistant

Pieces.app image

Our centralized storage agent works on-device, unifying various developer tools to proactively capture and enrich useful materials, streamline collaboration, and solve complex problems through a contextual understanding of your unique workflow.

👥 Ideal for solo developers, teams, and cross-company projects

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay