Wednesday, October 05, 2022

setting up git

In addition to my earlier git post, the following are useful resources for setting up git with global settings locally and so on. 

For enabling push to remote repos, we can set up the username and email globally - https://kbroman.org/github/tutorial/pages/first_time.html

git config --global user.name "My name"

git config --global user.email "email@example.com"

I had already set up ssh key etc. so 

ssh -T git@github.com

said successfully authenticated. 

More info:

https://docs.github.com/en/get-started/getting-started-with-git/managing-remote-repositories

https://docs.github.com/en/get-started/importing-your-projects-to-github/importing-source-code-to-github/adding-locally-hosted-code-to-github

What I did was:

git clone url_of_repo directory_name
cd directory_name
git branch hn # to create this new branch called hn
git checkout hn # if I wanted to edit the new branch

# after edits
git add .
git commit -m "commit message"
git push origin hn 

In travis-ci, I can choose to build my branch by choosing the custom build button, and choosing my branch from the drop-down.


No comments:

Post a Comment