Push the new git repository to GitHub
The final step is to add the remote git server and push the changes.
git remote add origin git@my-git-server:myrepository.gitgit push origin --all;git push origin --tags;
And that’s it! Congratulations, you have migrated your SVN repo into Git. The next step is to inform your team that the migration is complete and provide them access to the new remote git server.
----------------------------------------------------------------------------------
https://blog.simontimms.com/2013/04/02/importing-a-git-repository-into-tfs/
Now drop into the git repository you want to push to TFS and enter
git tf configure http://tfsserver:8080/tfs $/Scanner/Main
Wherehttp://tfsserver:8080/tfs is the collection path for your TFS server and$/Scanner/Main is the server path to which you’re pushing. This will modify your .git/config file and add the following:
[git-tf “server”] collection =http://tfsserver:8080/tfs serverpath =$/Scanner/Main
Your git repository now knows a bit about TFS. All you need to do now is push your git code up and that can be done using
git tf checkin --deep
This will push all the commits on the mainline of your git repo up into TFS. Without the ““deep flag only the latest commit will be submitted.
There are a couple of gotchas around branching. You may get this error:
git-tf: cannot check in - commit 70350fb has multiple parents, please rebase to form a linear history or use –shallow or –autosquash
You canflattenyour branches by either rebasing or by passing git-tf the ““autosquash flag which will attempt to flatten the branching structure automatically. I’m told that autosquashing can consume a lot of memory if there are a lot of commits in the repository. I have not had any issue but my repositories are small and my machine has 16GB of memory.
Now you have move all your source code over to TFS. Yay.
I’m not going to point out that if you keep git-tf around you can continue to work as if you have git and just push commits to TFS. That would likely be against your company’s policies
--------------------------------------------------------------------------------------------------------------
https://stackoverflow.com/questions/39478482/how-to-create-development-branch-from-master-on-github
Creating a git develop branch
You can list all of your current branches like this:
git branch -a
This shows all of the local and remote branches. Assuming you only have a single master
branch, you'd see the following:
* master
remotes/origin/master
The *
means the current branch.
To create a new branch named develop, use the following command:
git checkout -b develop
The -b
flag creates the branch. Listing the branches now should show:
* develop
master
remotes/origin/master
Changing branches
You shouldn't commit anything directly to the master
branch. Instead do all your work on the develop
branch and then merge develop into master
whenever you have a new public release.
You are already in your develop branch, but if you weren't, the way to switch is as follows:
git checkout develop
That's the same way you create a branch but without the -b
.
Making changes on develop
When making changes, add and commit as usual:
git add .
git commit -m "whatever"
The first time you push to your remote do it like so:
git push -u origin develop
The -u
flag stands for --set-upstream
. After the first time you only need to do it like this:
git push
Merging develop to master
Once your develop
is ready to merge into master
you can do it like so:
First switch to your local master branch:
git checkout master
To merge develop into master do the following:
git merge develop
Then push the changes in local master to the remote master:
git push
Done.
Deleting a branch
If you don't need the develop
branch anymore, or you just want to delete it and start over, you can do the following:
Delete the remote develop branch:
git push -d origin develop
Then delete the local branch:
git branch -d develop
The -d
means delete.
------------------------------------------------
git config --global user.name "John Doe"
git config --global user.email "johndoe@email.com"
.