Показ дописів із міткою Git. Показати всі дописи
Показ дописів із міткою Git. Показати всі дописи

вівторок, 23 лютого 2016 р.

Git: main commands

1. git status
Основной инструмент, используемый для определения, какие файлы в каком состоянии находятся
2. git add
Для того чтобы начать отслеживать (добавить под версионный контроль) новый файл, используется команда
3. git commit

понеділок, 1 лютого 2016 р.

Git: how to restore deleted no commited file

If the deletion has not been committed, the command below will restore the deleted file in the working tree.
$ git checkout -- <file>

четвер, 28 січня 2016 р.

How to push existing project to github

1. create repository in github
2. On your machine, first you will need to navigate to the project folder using git bash. When you get there you do:
git init
which initiates a new git repository in that directory.
When you've done that, you need to register that new repo with a remote (where you'll upload -- push -- your files to), which in this case will be github. You'll get the correct URL from your repo on GitHub.
$ git remote add origin https://github.com/[username]/[reponame].git
You need to add you existing files to your local commit:
git add .   # this adds all the files
Then you need to make an initial commit, so you do:
git commit -a -m "Initial commit" # this stages your files locally for commit. 
                                  # they haven't actually been pushed yet
Now you've created a commit in your local repo, but not in the remote one. To put it on the remote, you do the second line you posted:
git push --set-upstream origin master
3. Right click your project, select Team -> Share Project -> Git. Select the proposed line and press "Create repository". Press finish