0
votes

desktop1:

mkdir gitrepo
cd gitrepo
git init
git config --bool core.bare true

laptop:

git clone [email protected]:/home/desktop
cd gitrepo
vi readme
add readme
commit readme
git push

desktop1: I could not see the files here.

desktop2: I cloned to anoter 3rd system with the same as above command and I can see the file in 3rd system but not in the repository where I pushed.

So, how to update files in destop1 with the local changed files.

1
Is your desktop repository a bare repository (without a working directory)? Is your desktop set up as a Git server? This looks like a duplicate question of when you try to push to a non-bare repo.user456814
How are you able to push things from your laptop to desktop if your desktop isn't running a Git server? Are you using a file transfer protocol? What is the URI that you're using to push with?user456814
Why not just have a bare repository on your desktop to push to, then have another non-bare clone on the desktop that you use to fetch from the bare repo? You usually want to push to bare repos with Git.user456814
Exactly. You're not really supposed to push to non-bare repos.user456814
You can do it that way, or you can just make a new bare repo with git clone --bare <remote-uri>.user456814

1 Answers

0
votes
git checkout <file_name>
git checkout <branch_name> <file_name>
git checkout <branch_name>
git merge <branch_name>

Example:

git checkout master
git merge br1