Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Working on new feature , git clone or pull?

Lets say I clone a repository from remote, on my local I created new branch made changed and pushed this branch to remote where master and new branch is merged.

The next time when I need to work on new feature do I need to clone or pull the remote repository ? or git fetch

Whenever I start work on new feature do I have to get the latest copy of master branch ?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Git clone is required for only the first time to get copy of the repository to local.

You can create new feature branch from master to work on it. Once done, you can push and merge changes to master (Even delete the feature once you are done)

To avoid conflicts while creating new branches, it is best practice to git pull from master, create a feature branch and then make changes to your local repository.
In case you have any local changes already, you can choose to git stash them and switch to new branch (and unstash your changes in new branch)

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading