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. js数组转换问题

    一维数组转多维数组 var arr=[1,2,3,4,5,6,7,8,9,10]; function splitArray(arr,size){ var result = []; var tempAr ...

  2. 在使用EF时调用DBFUNCTION扩展方法时,发生ENTITYCOMMANDEXECUTIONEXCEPTION 异常的解决办法

    System.Data.Entity.Core.EntityCommandExecutionException : An error occurred while executing the comm ...

  3. 《DSP using MATLAB》示例Example5.19

    代码: n = 0:9; x = n+1; h = [1,0,-1]; N = 6; y = ovrlpsav(x,h,N); nh = 0:1:length(h)-1; ny = 0:1:lengt ...

  4. 分享一个基于长连接+长轮询+原生的JS及AJAX实现的多人在线即时交流聊天室

    实现网页版的在线聊天室的方法有很多,在没有来到HTML5之前,常见的有:定时轮询.长连接+长轮询.基于第三方插件(如FLASH的Socket),而如果是HTML5,则比较简单,可以直接使用WebSoc ...

  5. SAP中需要记住的一些标准表

    E070 请求号的抬头表 E071 请求号的行项目表 E07T 请求号的文本 E71K TASK的抬头(子请求) ******************************************* ...

  6. hdu 5652 India and China Origins 并查集

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5652 题目大意:n*m的矩阵上,0为平原,1为山.q个询问,第i个询问给定坐标xi,yi,表示i年后这 ...

  7. SYS与SYSTEM、DBA与SYSDBA的区别

    SYS与SYSTEM: 1. sys 的角色是sysdba system 的角色是sysoper 2. sys 具有create database的权限 system没有该权限 3. sys可以建数据 ...

  8. UICollectionView的使用小记录和一些说明

    // // MallTestViewController.h // fitmiss // // Created by bill on 16/6/28. // Copyright © 2016年 lea ...

  9. java: ant 脚本示例

    <?xml version="1.0" encoding="UTF-8"?> <!--basedir是从build.xml所在的目录为基础算起 ...

  10. MC700 安装双系统

    2011年买的MBP MC700给老婆用了一段时间后,老婆还不习惯不了Mac OS或是虚拟机,要求必须给安装windows,无奈时隔四年后,只能重新尝试在MC700上用bootcamp安装Window ...