git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Question with git push

From
PCPaul Vincent Craven <paul@cravenfamily.com>
Date
Dec 23, 2008, 16:59 UTC
Message-ID
<5591393c0812230859n3b50b1f9k36153f40dd75ff57@mail.gmail.com>

If I do a 'git push' to another repository, my changes are reverted the next time that repository is updated, unless I do a hard reset on the remote repository first. Of course, then I would lose my changes in the remote repository. What is the correct way of handling this?

A quick example:

mkdir -p RepositoryA/files RepositoryB cd RepositoryA/files echo "Test file" > test1.txt git init git add . git commit -a -m "Test Commit 1" cd ../../RepositoryB git clone ../RepositoryA/files cd files # I want this change to go to RepositoryA echo "More data" >> test1.txt git add . git commit -a -m "Test Commit 2" git push ../../RepositoryA/files cd ../../RepositoryA/files echo "Test file" > test2.txt git add . # This commit reverts test1.txt to not have "More data" git commit -a -m "Test Commit 3" # This reverts test1.txt to not git diff master^ master

How do I change my commands so I keep the change I made in RepositoryB?
Thanks,
-- 
Paul Vincent Craven

--
Paul Vincent Craven
http://www.cravenfamily.com
Next: Peter Harris
Message 1 of 3 in “Question with git push”
  1. Paul Vincent CravenDec 23, 2008
  2. Peter HarrisDec 23, 2008
  3. demerphqDec 23, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.