Open esther-86 opened 3 years ago
git clone git@gitlab.medable.com:automation/medable-automation-kt.git
>>> cd medable-automation-kt
>>> git branch -a
* dev
remotes/origin/HEAD -> origin/dev
remotes/origin/dev
remotes/origin/feature/kt-exercise
remotes/origin/master
>>> git checkout kt-exercise
error: pathspec 'kt-exercise' did not match any file(s) known to git
>>> git checkout feature/kt-exercise
Branch 'feature/kt-exercise' set up to track remote branch 'feature/kt-exercise' from 'origin'.
Switched to a new branch 'feature/kt-exercise'
>>> git branch
dev
* feature/kt-exercise
>>> git checkout -b feature/kt-exercise-esther
Switched to a new branch 'feature/kt-exercise-esther'
>>> git push -u origin feature/kt-exercise-esther
Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
remote:
remote: To create a merge request for feature/kt-exercise-esther, visit:
remote: ...
* [new branch] feature/kt-exercise-esther -> feature/kt-exercise-esther
Branch 'feature/kt-exercise-esther' set up to track remote branch 'feature/kt-exercise-esther' from 'origin'.
https://stackoverflow.com/a/37482577/5885721 When you want to commit something in your branch, be sure to be in your branch. You can see all branches created by using git branch
>>> git branch
dev
feature/kt-exercise
* feature/kt-exercise-esther
If you have been making commits on your main branch while you coded, but you now want to move those commits to a different branch, this is a quick way:
Copy your current history onto a new branch, bringing along any uncommitted changes too:
git checkout -b
git branch -f
git branch -f master origin/master or if you had made 4 commits:
git branch -f master HEAD~4
SSH: https://medium.com/codex/clone-github-private-repository-using-ssh-on-mac-acc9110d1cfe