Branches are just pointers to commits

Every branch is simply a named pointer to a commit. A special unique pointer for every repository is the HEAD which points to the commit the working tree state currently corresponds to. The HEAD cannot only point to a commit, but also to a local branch, which itself points to a commit. Committing changes will create a new commit on top of the commit or local branch the HEAD is pointing to. If the HEAD points to a local branch, the branch pointer will be moved forward to the new commit; thus the HEAD will also indirectly point to the new commit. If the HEAD points to a commit, the HEAD itself is moved forward to the new commit.

Push

The various Push commands allow you to push (i.e. send) your local commits to one or more remote repositories. SmartGit distinguishes between the following Push commands:

  • Push Pushes all commits in one or more local branches to their matching remote branches. More precisely, on the Push dialog you can choose between pushing the commits in the current branch to its matching remote branch, and pushing the commits in all local branches with matching remote branches to said remote branches. A local branch `matches' a remote branch if the branch names match, e.g. `master' and `origin/master'. With this Push command you can push to multiple repositories in a single invocation. SmartGit will detect automatically whether a forced push will be necessary.
  • Push To Pushes all commits in the current branch either to its matching branch, or to a ref specified by name. With the Push To command you can only push to one remote repository at a time. If multiple repositories have been set up, the Push To dialog will allow you to select the remote repository to push to. Also, the Push To command always allows to do a forced push, what can be convenient. This is necessary when pushing to a secondary remote repository for which forcing the push may be necessary while it is not when pushing to the primary remote repository (i.e. the one which is considered by SmartGit's forced push detection). You can also invoke Push To on a remote to push (or synchronize) all branches from the selected remote to another remote.
  • Push Commits Pushes the selected range of commits from the Outgoing view, rather than all commits, in the current branch to its tracked remote branch.

If you try to push commits from a new local branch, you will be asked whether to set up tracking for the newly created remote branch. In most cases it is recommended to set up tracking, as it will allow you to receive changes from the remote repository and make use of Git's branch synchronization mechanism (see Branches).

The Push commands listed above can be invoked from several places in SmartGit's project window:

  • Menu and toolbar In the menu, you can invoke the various Pull commands with Remote|Push, Remote|Push To and Remote|Push Commits. The first two may also be available as toolbar buttons, depending on your toolbar configuration. The third command is only enabled if the Outgoing view is focused.
  • Repositories view You can invoke Push in the Repositories view by selecting the open repository and choosing Push from the context menu.
  • Branches view In the context menu of the Branches view, you can invoke Push and Push To on local branches. Additionally, you can invoke Push on tags.
  • Outgoing view To push a range of commits up to a certain commit, select that commit in the Outgoing view and invoke Push Commits from the context menu.

随机推荐

  1. SPRING IN ACTION 第4版笔记-第十一章Persisting data with object-relational mapping-006Spring-Data的运行规则(@EnableJpaRepositories、<jpa:repositories>)

    一.JpaRepository 1.要使Spring自动生成实现类的步骤 (1)配置文件xml <?xml version="1.0" encoding="UTF- ...

  2. Jackson学习笔记-对象序列化

    一.用ObjectMapper.readValue(jsonString, Student.class) , ObjectMapper.writeValueAsString(student) impo ...

  3. Java:正则表达式的详解

    正则表达式:符合一定规则的表达式. 作用:用于专门操作字符串. 特点:用一些特定的符号来表示一些代码的操作.这样就简化书写.所以学习正则表达式就是学习一些特殊符号的使用. 好处:可以简化对字符串的操作 ...

  4. 转 RMI、RPC、SOAP通信技术介绍及比对

    http://www.open-open.com/home/space.php?uid=37924&do=blog&id=8974 1.RMI 使用java的程序员,对于RMI(Rem ...

  5. 解决NetworkOnMainThreadException

    今天在Android 访问 WebService 的时候遇到,错误Caused by: android.os.NetworkOnMainThreadException,查了下原因上在4.0之后在主线程 ...

  6. 关于JavaScript的思考

    像apply这种函数,只有动态语言才能完成,动态语言既编译器/解释器这类代码生成器完成自己职责时只能在运行时完成,例如函数参数的压栈.仔细想想可能不对,也可以通过编译来完成 apply和call的使用 ...

  7. Servlet如何实现修改后不重启服务器而生效

    只需在apache-tomcat-8.0.0-RC10\conf\servlet.xml中修改相关设置:   在<Host name="localhost"  appBase ...

  8. 关于MySQL

    DBMS - 数据库管理系统(Database Management System) RDBMS - 关系数据库管理系统(Relational Database Management System) ...

  9. scroll 事件绑定

    var animateBlock={        isVisiable:function(el,wh,st,delta){            delta=delta||200;          ...

  10. Ubuntu Server搭建svn服务以及迁移方法【转】

    转自:http://www.linuxidc.com/Linux/2013-05/84693.htm Ubuntu Server搭建svn服务以及迁移方法 采用apache+svn,http访问方式. ...