Table of Contents |
---|
...
Code Block |
---|
ssh -vvvT git@gitlab.prod.sdc.dot.gov |
⏬ Clone a Repository
Now that you have a working ssh key, you can clone a repository to your workstation.
In your browser in SDC, go to https://gitlab.prod.sdc.dot.gov and navigate to the repository you wish to clone.
Clone > Clone with SSH > Copy URL
Back in the Git Bash application, first `cd ~/` to make sure you are in your home directory. Then type `git clone`, then right click and paste in what you copied from GitLab:
You now have the repository cloned to C:\Users\{yourusername}\{repository}
As always, git pull when you start up your workstation. Do work, then git push at least once at the end of your day. The GitLab service is backed up, and you should treat anything on your Windows workstation just like you would on a C:\ drive on laptop.
Git commands to remember
For working off the master branch, do this before starting work (after you log on to SDC, open up Git Bash and run these):
Code Block |
---|
git status
git pull |
For working off the master branch, do this any time you want to push.
Code Block |
---|
git status
git pull |
Optional, if you started a new script or want to add any other new files to the repo:
Code Block |
---|
git add . |
Optional, if you want to add one specific file to the repo:
Code Block |
---|
git add <type the file name> |
Use `-am` option in git commit to add any changes and type a short message about the commit in one step
Code Block |
---|
git commit -am '<type some message here>' |
Code Block |
---|
git push |