[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

git commit/push and VC

From: Stephen Berman
Subject: git commit/push and VC
Date: Thu, 20 Nov 2014 00:36:29 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

I'm still learning how to use git, and have two questions about `git
commit' and `git push'.  I've read the "GitForEmacsDevs" page at
emacswiki.org and Conversational Git (recommended on that page), and
unless I'm misunderstanding something (which is not unlikely), they
disagree about what's needed to export changes from one repository to
another, or from one branch to another within a single repository.
Conversational Git say to use `git commit' and then `git push'.
GitForEmacsDevs says this:

   If you are a committer, you can merge to the upstream master directly.

   First, update your repository:
         cd $DEVHOME/emacs
         git checkout master
         git pull
         git merge TASKNAME
         git push
   Run the tests:
         make check
   and then commit
         git status
         git commit -m "fixes debbugs:12345"
   which merges all your new commits to the upstream master.

I don't understand why `git commit' follows `git push' here (or why
there isn't another `git push' after `git commit').  Indeed, I've done
local tests of moving changes between branches and repositories, and
they appear to confirm what Conversational Git says: unless `git push'
follows `git commit', the changes are not available in the other branch
or repositories.  So is GitForEmacsDevs wrong or is there something else
going on here?

My second question is about using VC in Emacs.  With bzr, typing `C-c
C-c' in the *vc-log* buffer exported my local trunk changes to trunk at
Savannah, because my local trunk was a bound branch.  But according to
my local tests, with git typing `C-c C-c' in the *vc-log* buffer only
commits the changes to the checked out branch; they do not show up in
branch or repository the checked out branch was branched from (or its
repository was cloned from).  Is this correct?  I don't want to
accidentally push changes to master or another branch at Savannah.  And
if `C-c C-c' does only do commits on the checked out local branch, it is
possible to use VC to push changes to another branch or repository, and
if so, how?

Steve Berman

reply via email to

[Prev in Thread] Current Thread [Next in Thread]