git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / Atom feed
From: Philip Oakley <philipoakley@iee.org>
To: Rocky Ji <rockyji3438@gmail.com>, git@vger.kernel.org
Subject: Re: How to update Git's metadata without affecting working dir?
Date: Fri, 17 May 2019 21:54:21 +0100
Message-ID: <b3e170ed-ca5f-c754-892a-d11d4b71d989@iee.org> (raw)
In-Reply-To: <CAN2Gq-Rb3v8-8PKmKUGKJ3wP-UvAF2n59a9UGbtjiGibE8q=zg@mail.gmail.com>

This is a duplicate of a question on the Git Users list.

On 17/05/2019 18:04, Rocky Ji wrote:
> I am working individually at the moment.
> I have the habit of committing related changes on a regular basis, but
> I push to GitLab only at the end of class session.
>
> -------Events to reproduce the situation--------
>
> Thursday, in school:
> - `git clone https://gitlab.../my-repo`
> - create a few .rst documentation files
> - commit the above changes before I `git push -U origin master`
>
> Friday, in school:
> - start working on new feature, create a test file `test_A.rb`
> - I commit the changes but forget to push
>
> Sunday, **in home**:
> - I `git clone https://gitlab.../my-repo`
> - work on the exciting new feature that popped in my head, create `feature.rb`
> - commit the changes before I `git push -U origin master`
>
> Monday, in school:
> - running `git status` shows `Your branch is ahead of 'origin/master'
> by 1 commit.`
>
> --------end problem reproduction----------------
>
> Questions I have
>
> 1. What will happen if I follow Git's recommendation `use "git push"
> to publish your local commits`?
> 2. How do I resolve this situation? I don't want loose any information
> i.e. preserve `test_A.rb` and `feature.rb` along with their commit
> messages and timestamps.
> 3. Why does Git assume that local-working-dir is "ahead" without
> consulting the Gitlab server first?
> 4. How to make Git "consult" (but not mess the working-dir) GitLab
> repo before starting my day's work?
>
> Thank you.


  reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-17 17:04 Rocky Ji
2019-05-17 20:54 ` Philip Oakley [this message]
     [not found]   ` <CAN2Gq-RNt2x-023qC2LWawYGUz5g08=oVK+ub4iLGnh90aQdyQ@mail.gmail.com>
2019-05-18  8:29     ` Rocky Ji

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b3e170ed-ca5f-c754-892a-d11d4b71d989@iee.org \
    --to=philipoakley@iee.org \
    --cc=git@vger.kernel.org \
    --cc=rockyji3438@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

git@vger.kernel.org list mirror (unofficial, one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.org/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox