1

So, I'm stuck with git pull.

I'm currently working on final project, and teacher told us to use putty to make our web goes online.

Actually all good when I'm done working with it, but then few changes need to be added.

I don't know if we have to do

git pull

on putty once we have commited or merge our our work, but instead I edited it via 'mc' (affecting the online ones, directly).

To put it simple, I edited it first at putty (via mc, for online), then I make changes on github

I have the same problem with friends, and solved by

git stash

But mine seems didn't work

Is there a way to solve it?

Of course, I can still working by edited it changes one by one via mc, which is sucks

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Hermes Djohar
  • 111
  • 1
  • 3
  • 16
  • Are you in a shell on your computer or are you ssh'ed into the remote server? – tbjgolden Feb 26 '17 at 22:19
  • back it up locally, use `git pull` and it may merge happily enough, if it says there are merge conflicts then you should look up [git merge](https://git-scm.com/docs/git-merge) – tbjgolden Feb 26 '17 at 22:57
  • Please ask a T.A. instead, or someone who can help you in real life - the weak grasp of the terminology here is clear evidence that you don't understand the tools you are using well enough to ask the right questions. – Pockets Feb 26 '17 at 23:41

1 Answers1

0

If you are using Git 2.9 (June 2016) or more, see "Can “git pull” automatically stash and pop pending changes?"

Add a config

git config --global pull.rebase true
git config --global  rebase.autoStash true

That way, only a git pull is needed to reconcile local and remote working.

After the git pull, commit and push. Your local work will then be published to the remote repo.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250