简体   繁体   中英

git changes not reflected on remote repository

Ok, I configured a bare git for me and another person to use for a project. We have the git set up on a linux computer and it seems to have worked ok. He added a text file to the git on the linux computer. Then he cloned from his local machine over ssh and edited the file and committed it. When I viewed the file again on the linux computer it has not been changed, but if I clone from my local machine I can see the changes.

Question: Why aren't the changes showing in the original file on the linux computer?

EDIT: We have both made changes and pushed, and they both show up on each other's machines when we clone(even new files) where are they being stored then? I made the repository and there is a .git inside of the directory and it is bare so we can do a shared repo.

EDIT2: I did a git pull on the linux machine and it updated the files. is there a way to make it update this automatically?

Use git push to push your local branch to a remote repository.

For example:

git push  REMOTENAME BRANCHNAME

As an example, you usually run git push origin master to push your local changes to your online repository.

Make sure you're pushing your changes. Something like "git push origin master" will do the trick. "Origin" being the name of your remote and "master" being the branch name. If you haven't already done a code push after committing your changes, try that and it should solve your problem.

I would recommend checking the permissions on the origin repo just to make sure it allows you to push your commits. You wanna also do git fetch -all for any updates from the main repo.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM