Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
linux:git [2019/10/05 19:31] – [Atom, Git and Rust] mh | linux:git [2020/06/01 16:35] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 30: | Line 30: | ||
< | < | ||
+ | cd existing_folder | ||
+ | git init //Skip if in a Rust project created with cargo, git is already initialized | ||
git remote add origin < | git remote add origin < | ||
- | git push --all origin | + | git add . // |
+ | git commit | ||
+ | git push -u origin | ||
</ | </ | ||
You will be prompted for username and password of owner of the Git distant repository. | You will be prompted for username and password of owner of the Git distant repository. | ||
- | Edit (Fall 2019) : This actually doesn' | + | Atom has a built-in git feature that will automatically detect git repositories and has a useful GUI. To use it, your project root folder **must be directly** in the project tree manager. It cannot be in a sub-directory or Atom will **not** autodetect the git repository. |
If you want to set all of your branches to automatically use this remote repo when you use git pull, add --set-upstream to the push: | If you want to set all of your branches to automatically use this remote repo when you use git pull, add --set-upstream to the push: | ||
Line 44: | Line 48: | ||
</ | </ | ||
- | This is the advised way to push to a new repo by Git Lab and works perfectly well with a Rust project. | + | ==== Branching ==== |
+ | //The following | ||
+ | |||
+ | |||
+ | When creating another branch, to have it appear in Atom run the following command : | ||
< | < | ||
- | cd existing_folder | + | git fetch origin |
- | git init //Skip if in a Rust project created with cargo, git is already initialized | + | |
- | git remote add origin [Remote Repository Address.git] | + | |
- | git add . //Not sure it's required, since the folder is already populated. | + | |
- | git commit -m " | + | |
- | git push -u origin | + | |
</ | </ | ||
- | Atom has a built-in git feature that will automatically detect git repositories and has a useful GUI. To use it, your project root folder **must be directly** | + | |
+ | This will fetch all the data in the origin' | ||
+ | |||
+ | Then run : | ||
+ | |||
+ | < | ||
+ | git pull origin <name-of-branch> | ||
+ | </ | ||
+ | |||
+ | This should update | ||
+ | |||
+ | If this does not work, maybe it is required to create the branch in atom with the "new branch" | ||
+ | |||
+ | |||
===== Ressources ===== | ===== Ressources ===== | ||
[[https:// | [[https:// |