简体   繁体   中英

Create Collaboration Project using GitHub and VSCode

I have to work on a school project in a team and we've decided to use GitHub & VSCode to edit the code. I am a complete Noob in using GitHub & VSCode as I only every coded alone. I created a repository and I have invited my teammate as a collaborator. I also cloned the repo to both our laptops and we both can commit changes, but if I commit a change his VSCode doesn't get refreshed.

I am sorry but could someone explain what options we have? I know that you can pull changes but I wanted both to be on the original repository and pulling seems to give me a error because I pull from and to the same branch.

Any help is greatly appreciated!

I also cloned the repo to both our laptops

That means your VSCode is linked to the same remote repository.
Since a git commit is a local action, you need to push.

If you are both working on the same branch, you will also need to pull in order to fetch and merge changes pushed by your colleague.
You can trigger that through the Git Status Bar .

The other command to look into is pull

The git pull command is used to fetch and download content from a remote repository and immediately update the local repository to match that content. Merging remote upstream changes into your local repository is a common task.

The best strategy is to create branches for the set of additions etc you intend to add to the master and then merge them in as you complete the work. That means that if there are conflicts then it happen at the branches and those conflicts then can be resolved. Think of your working copies as just that working copies that can be refreshed totally separately from what is online.

Good luck with your project, what you['re doing is a very sensible and professional approach to problem solving and collaborating.

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