| By Using Git and Visual Studio 2015 to do Pull, Push and Edit files?
Here in this tutorial you will learn how to do pull, push and Edit files from the master branch in Github repo, then we do edit files and pulled from that repo to upload it to new separate branch. Now below are different steps to do all of these operations:-
(1)In our first step we open VS2015 and then Team Explorer (View -> Team Explorer), then select manage connections (Powerplud icon).
And then we should see title Local Git Repositories.
We can select clone then enter the url of the github repo you would like to clone.
(2)Now you can open the local repository by just selecting from the right click -> open. After that this will take you to the Team Explorer home tab for the repository here by selecting the Branches.
(3)This will take you to branches screen, then you will select a branch by right click -> New Local Branch from...
(4)Now you will be prompted to name your branch, then click Create Branch
(5)Here your branch will be automatically checkout if checkout branch is ticked. otherwise it should appear in the list of branches where you can right click -> checkout.
Now we can make free changes. ANd once you are ready to commit select the changes tab from the Team Explorer Home menu. Now you can see all the changes and here you have option of staging, by just right clicking each file you would like to commit and staging it, or by committing all changes by selecting commit all.
(6)Now the changes are commited to your local repo, to push to a new remote branch you will need to publish. To do this go to the Sync tab from the Team Explorer home tab and select publish.
And if you are using Terminal then you can use below commands
git clone https://github.com/project/url
cd new_project_folder
git checkout master This will make sure you are on the master branch.
git checkout -b new_branch_name This creates a new branch off of master
open project in Visual studio and make changes as desired.
Back in terminal
And if you are using Terminal then you can use below commands
git add . This will stage all your changes
git commit -m 'write your commit message here' Commit your changes
git push -u origin new_branch_name This will push your changes to GitHub
| | |