reset - Git: How to move back and forth between commits -


I have a newbie question about Git:

I need to move forward in history a branch. That means, I have to get all those files in those states which are in some old amendments, and then I have to go back to the latest position in the repository. I do not have to commit.

To sync pre-> svn up

with the repository.

I think I want to know the hash of committed to return, so I tried

  git reset & lt; Hash & gt;  

That's what I'm getting there but then I tried

  git pull  

but it's about protest Complains in

So what is the right way to go through history?

I am thinking in terms of SVN, so do not be too excited to point me to some good tutorials. Note that I have already checked.

Thank you, Ondre.

Well, I am also a former SVN user, and now use GIT for all my projects .

When you use GIT, you should change the way you think with the client-server architecture used in SVN. In Svn, each change requires a connection with the server. Using GIT, your repo is in working directory, you do not need connection for each repo operation.

Only git push and drag to git to synchronize with repo. Think about using rsync or any backup solution to create two types of similar content about it, like if you connect to an external backup hard disk, then create the content in your head with the content in it. This is for use with git pull and git push .

If you want to go back and forth history, use it in git checkout . See the revision ID using git history If you are using Linux, use gitk to view the tree of amendment. Turtle GIT in Windows can display it using the modification graph.

To return to the latest revision, use git checkout master before placing any order, always git status yourself. This command will show you anything to know about the current repo situation, and what you need to do to make it right. Before git pull and git push , it is better to make sure that the git status results in the text working directory clean up Is .

If you need to back up the file in the previous revision, you can do this by git merge . Before you make a file, check it before git diff pre: git diff rev1: rev2 file name . There will be any separate print between this two revisions. Changes in Rev1 will be replaced by changes in rev2. So back to rev2, rev2 will be older than rev1 After you are satisfied with the difference result, do this with git merge , simply diff to merge < Change with / code>, all other parameters remain the same.

I hope this will help you, the main key is to know that understanding your work is your repo, you will be able to use the guit in its full potential. Best wishes


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -