8月1日 Git Branch Revert 简历应用

来源:互联网 发布:java 防止 sql注入 编辑:程序博客网 时间:2024/06/05 16:39

一直在用文件夹自己在改简历,看上去挺2的,一直想用Git玩玩,这下午闲着没事就奉献在这上面了。

git checkout -b iss53

建一个新的branch,相当于:

git branch iss53$ git checkout iss53

然后搞搞搞,搞回来可以回到Master,

用merger Master,这样Master就被推到最新的里了,注意这时候是fast-forward.

此时ISS53没用,于是过河拆桥。

git branch -d iss53.

如果在建iss53之后,在merge之前搞出来个iss54,在上述动作完后,还有个iss54 branch。

当54搞完准备合并到merge里,原先的base变成53之后了,这时候还是checkout到Master然后合并,但多了一步,见图:

最后是想返回看文件:

git checkout -b iss53

First, you’ll need to find the ID of the revision you want to see.

git log --oneline

Let’s say your project history looks something like the following:

b7119f2 Continue doing crazy things
872fa7e Try something crazy
a1e8fb5 Make some important changes to hello.py
435b61d Create hello.py
9773e52 Initial import

You can use git checkout to view the “Make some import changes to hello.py” commit as follows:

git checkout a1e8fb5

This makes your working directory match the exact state of the a1e8fb5 commit. You can look at files, compile the project, run tests, and even edit files without worrying about losing the current state of the project. Nothing you do in here will be saved in your repository. To continue developing, you need to get back to the “current” state of your project:

git checkout master

This assumes that you're developing on the default master branch, which will be thoroughly discussed in the Branches Module.

Once you’re back in the master branch, you can use either git revert or git reset to undo any undesired changes.

最后想想看,如果想要用git来做resume的version control,可以在pursuit相关文件夹里加个repository,然后搞搞搞,弄完一个公司push一下,加个comment,然后搞到网上去,如果想看回来看是了。

权限是个问题,但是应该也没人偷吧。。



git checkout -b iss53
0 0
原创粉丝点击