Can anybody tell me how to revert the commit and push the files for review?

376    Asked by AadityaSrivastva in Devops , Asked on Jul 25, 2023

I am totally unknown to git and I have included few files in git:

Git add
Git add

After that I wished to push it for review, but I comitetd an error

Git commit

Hence the files I have altered don’t go forr eviews.

On entering the command

Git status

I receive the message

# On Branch master
# Your branch i ahead of ‘origin/master’ by 1 commit.
#
Nothing to commit (working directory clean)

I wish to revert the commit and push th files for review. How do I do so?

It is not possible to push anything that has not been committed. The pattern of operations is as follows:

Make your change.

Git add - this levels the alterations in the file for committing.
Git commit - this will commit the leveled file locally and be recorded by git.
Git push- this pushes the committed alterations in the file to the remote repository.

When you push without committing, nothing is pushed. When you commit without including, nothing is committed. When you include without vomiting, nothing occurs, git hardly remembers that the alterations included must be prioritized for the next commit.

The message you see implies that the native repository possesses a single commit that is not yet pushed. Add and commit refer to local operations, push, pull and fetch that communicate with a remote. As there is an official source control workflow in the area where you perform, you must enquire internally how this must be managed. The message you receive implies that the local repository possess a commit that has not been pushed. The DevOps certification trainingoffered at JanBask offers an experience alike offline classes and provides a total DevOps discipline preparation by teaching all the core concepts and techniques required to fetch a job as a DevOps engineer. Janbask imparts a coherent and extensive training process through interesting e-learning equipments. They support in making you job-ready and help you possess the potential to build powerful business strategies leading to considerable and valuable outputs. On completion of the course, you can gain competent skills and smart tactics to proceed in the tempting job market.



Your Answer

Interviews

Parent Categories